{"action":"created","issue":{"url":"https://api.github.com/repos/docker/compose/issues/3172","repository_url":"https://api.github.com/repos/docker/compose","labels_url":"https://api.github.com/repos/docker/compose/issues/3172/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/3172/comments","events_url":"https://api.github.com/repos/docker/compose/issues/3172/events","html_url":"https://github.com/docker/compose/issues/3172","id":142212396,"number":3172,"title":"Question about compose and container IDs","user":{"login":"formerlyKurt","id":12293121,"avatar_url":"https://avatars.githubusercontent.com/u/12293121?v=3","gravatar_id":"","url":"https://api.github.com/users/formerlyKurt","html_url":"https://github.com/formerlyKurt","followers_url":"https://api.github.com/users/formerlyKurt/followers","following_url":"https://api.github.com/users/formerlyKurt/following{/other_user}","gists_url":"https://api.github.com/users/formerlyKurt/gists{/gist_id}","starred_url":"https://api.github.com/users/formerlyKurt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/formerlyKurt/subscriptions","organizations_url":"https://api.github.com/users/formerlyKurt/orgs","repos_url":"https://api.github.com/users/formerlyKurt/repos","events_url":"https://api.github.com/users/formerlyKurt/events{/privacy}","received_events_url":"https://api.github.com/users/formerlyKurt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/compose/labels/kind/question","name":"kind/question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-20T22:06:02Z","updated_at":"2016-03-22T20:16:36Z","closed_at":null,"body":"Is there a way for compose to store (as an environment variable) the container ID of a running container? It would also be nice if there is a way for compose to store in an env var the image ID that a container was made from.  If this is something that compose can already do, how would I go about doing this?\r\n\r\nHere's the background on what I'm trying to solve for: \r\n\r\nIf Jenkins is creating images and spinning up containers for testing, I need a way to uniquely identify the logs from each container so that when I copy them out of the Jenkins workspace I know which image/container generated which log.  If specifying the container ID as an env var is possible, then I can add this as the name of the logging file by specifying this in the compose file:\r\n\r\n`log.file=${CONTAINER_ID}-${COMPOSE_PROJECT_NAME}.log`\r\n\r\nThanks...any thoughts about this are greatly appreciated!"},"comment":{"url":"https://api.github.com/repos/docker/compose/issues/comments/200002217","html_url":"https://github.com/docker/compose/issues/3172#issuecomment-200002217","issue_url":"https://api.github.com/repos/docker/compose/issues/3172","id":200002217,"user":{"login":"formerlyKurt","id":12293121,"avatar_url":"https://avatars.githubusercontent.com/u/12293121?v=3","gravatar_id":"","url":"https://api.github.com/users/formerlyKurt","html_url":"https://github.com/formerlyKurt","followers_url":"https://api.github.com/users/formerlyKurt/followers","following_url":"https://api.github.com/users/formerlyKurt/following{/other_user}","gists_url":"https://api.github.com/users/formerlyKurt/gists{/gist_id}","starred_url":"https://api.github.com/users/formerlyKurt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/formerlyKurt/subscriptions","organizations_url":"https://api.github.com/users/formerlyKurt/orgs","repos_url":"https://api.github.com/users/formerlyKurt/repos","events_url":"https://api.github.com/users/formerlyKurt/events{/privacy}","received_events_url":"https://api.github.com/users/formerlyKurt/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T20:16:36Z","updated_at":"2016-03-22T20:16:36Z","body":"I think this `docker-compose run SERVICE env` gives me all the info that I need. :)"}}