{"action":"closed","issue":{"url":"https://api.github.com/repos/docker/compose/issues/2038","labels_url":"https://api.github.com/repos/docker/compose/issues/2038/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/2038/comments","events_url":"https://api.github.com/repos/docker/compose/issues/2038/events","html_url":"https://github.com/docker/compose/issues/2038","id":106243621,"number":2038,"title":"Adding new link does not update /etc/hosts with name specified in docker-compose.yml","user":{"login":"rpwashburn","id":3782232,"avatar_url":"https://avatars.githubusercontent.com/u/3782232?v=3","gravatar_id":"","url":"https://api.github.com/users/rpwashburn","html_url":"https://github.com/rpwashburn","followers_url":"https://api.github.com/users/rpwashburn/followers","following_url":"https://api.github.com/users/rpwashburn/following{/other_user}","gists_url":"https://api.github.com/users/rpwashburn/gists{/gist_id}","starred_url":"https://api.github.com/users/rpwashburn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpwashburn/subscriptions","organizations_url":"https://api.github.com/users/rpwashburn/orgs","repos_url":"https://api.github.com/users/rpwashburn/repos","events_url":"https://api.github.com/users/rpwashburn/events{/privacy}","received_events_url":"https://api.github.com/users/rpwashburn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/compose/labels/kind/bug","name":"kind/bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-13T22:16:37Z","updated_at":"2015-09-14T19:42:08Z","closed_at":"2015-09-14T19:42:08Z","body":"Starting with a docker-compose file with an apache container specified:\r\n\r\n```\r\napache:\r\n  image: apache\r\n  ports:\r\n    - \"80:80\"\r\n```\r\n\r\nAfter I initially docker-compose up on this file, if I go back in and make the docker-compose file look like this: \r\n```\r\napache:\r\n  image: apache\r\n  ports:\r\n    - \"80:80\"\r\n  links:\r\n    - \"reviewservice\"\r\n  volumes:\r\n    - ./hosts:/etc/apache2/sites-enabled\r\n\r\nreviewservice:\r\n  image: reviewservice\r\n  ports:\r\n    - \"3000:3000\"\r\n```\r\nIf I exec into the apache container after stopping apache then docker-compose up, I do not see an entry for reviewservice in the /etc/hosts, only entries for docker compose generated names.\r\n\r\n```\r\n172.17.0.46\t5dabc584af18\r\n127.0.0.1\tlocalhost\r\n::1\tlocalhost ip6-localhost ip6-loopback\r\nfe00::0\tip6-localnet\r\nff00::0\tip6-mcastprefix\r\nff02::1\tip6-allnodes\r\nff02::2\tip6-allrouters\r\n172.17.0.44\tcosmos_reviewservice_1 0e0e53f405a2\r\n172.17.0.46\tcosmos_apache_1\r\n172.17.0.46\tcosmos_apache_1.bridge\r\n172.17.0.44\tcosmos_reviewservice_1\r\n172.17.0.44\tcosmos_reviewservice_1.bridge\r\n```\r\nThere is no entry for just reviewservice, which is how my code in the apache container is expecting to  reference my review service.\r\nHowever, if I docker-compose rm apache, then docker-compose up and check the /etc/host, the entry for reviewservice is there and everything works.\r\n```\r\n172.17.0.46\t5dabc584af18\r\n127.0.0.1\tlocalhost\r\n::1\tlocalhost ip6-localhost ip6-loopback\r\nfe00::0\tip6-localnet\r\nff00::0\tip6-mcastprefix\r\nff02::1\tip6-allnodes\r\nff02::2\tip6-allrouters\r\n172.17.0.44\treviewservice_1 0e0e53f405a2 cosmos_reviewservice_1\r\n172.17.0.44\tcosmos_reviewservice_1 0e0e53f405a2\r\n172.17.0.44\treviewservice 0e0e53f405a2 cosmos_reviewservice_1\r\n172.17.0.46\tcosmos_apache_1\r\n172.17.0.46\tcosmos_apache_1.bridge\r\n172.17.0.44\tcosmos_reviewservice_1\r\n172.17.0.44\tcosmos_reviewservice_1.bridge\r\n```\r\nI'm assuming that i should not have to rm the apache image everytime I update a new link in the yml file."}}