{"action":"created","issue":{"url":"https://api.github.com/repos/docker/compose/issues/1276","labels_url":"https://api.github.com/repos/docker/compose/issues/1276/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/1276/comments","events_url":"https://api.github.com/repos/docker/compose/issues/1276/events","html_url":"https://github.com/docker/compose/issues/1276","id":67462333,"number":1276,"title":"`run` does not set links","user":{"login":"mihneadb","id":643127,"avatar_url":"https://avatars.githubusercontent.com/u/643127?v=3","gravatar_id":"","url":"https://api.github.com/users/mihneadb","html_url":"https://github.com/mihneadb","followers_url":"https://api.github.com/users/mihneadb/followers","following_url":"https://api.github.com/users/mihneadb/following{/other_user}","gists_url":"https://api.github.com/users/mihneadb/gists{/gist_id}","starred_url":"https://api.github.com/users/mihneadb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihneadb/subscriptions","organizations_url":"https://api.github.com/users/mihneadb/orgs","repos_url":"https://api.github.com/users/mihneadb/repos","events_url":"https://api.github.com/users/mihneadb/events{/privacy}","received_events_url":"https://api.github.com/users/mihneadb/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/compose/labels/area/run","name":"area/run","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-04-09T22:16:58Z","updated_at":"2015-09-18T11:36:04Z","closed_at":null,"body":"I have a docker-compose.yml file along the lines of:\r\n\r\n\tanalytics:\r\n\t    build: .\r\n\t    links:\r\n\t\t- mongo:mongo\r\n\t    ports:\r\n\t\t- 80:80\r\n\tmongo:\r\n\t    build: docker_containers/mongo\r\n\t    expose:\r\n\t\t- 27017\r\n\r\nRunning `docker-compose up` creates a link in `/etc/hosts` to the `mongo` service. However, running `docker-compose run analytics bash` does not create the link -- I checked the `/etc/hosts` file.\r\n\r\nThe docs of docker-compose do not mention anything about this, so I'm confused.\r\n\r\n1. Why isn't the link set when using `run`?\r\n2. How can I achieve this?\r\n\r\n\r\n[original SO question](https://stackoverflow.com/questions/29474299/docker-compose-run-does-not-set-links)"},"comment":{"url":"https://api.github.com/repos/docker/compose/issues/comments/141424290","html_url":"https://github.com/docker/compose/issues/1276#issuecomment-141424290","issue_url":"https://api.github.com/repos/docker/compose/issues/1276","id":141424290,"user":{"login":"GustavoRPS","id":516827,"avatar_url":"https://avatars.githubusercontent.com/u/516827?v=3","gravatar_id":"","url":"https://api.github.com/users/GustavoRPS","html_url":"https://github.com/GustavoRPS","followers_url":"https://api.github.com/users/GustavoRPS/followers","following_url":"https://api.github.com/users/GustavoRPS/following{/other_user}","gists_url":"https://api.github.com/users/GustavoRPS/gists{/gist_id}","starred_url":"https://api.github.com/users/GustavoRPS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GustavoRPS/subscriptions","organizations_url":"https://api.github.com/users/GustavoRPS/orgs","repos_url":"https://api.github.com/users/GustavoRPS/repos","events_url":"https://api.github.com/users/GustavoRPS/events{/privacy}","received_events_url":"https://api.github.com/users/GustavoRPS/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T11:36:04Z","updated_at":"2015-09-18T11:36:04Z","body":"+1"}}