{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/14755","labels_url":"https://api.github.com/repos/docker/docker/issues/14755/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/14755/comments","events_url":"https://api.github.com/repos/docker/docker/issues/14755/events","html_url":"https://github.com/docker/docker/issues/14755","id":96084689,"number":14755,"title":"getaddrinfo ENOTFOUND","user":{"login":"ianblenke","id":1844764,"avatar_url":"https://avatars.githubusercontent.com/u/1844764?v=3","gravatar_id":"","url":"https://api.github.com/users/ianblenke","html_url":"https://github.com/ianblenke","followers_url":"https://api.github.com/users/ianblenke/followers","following_url":"https://api.github.com/users/ianblenke/following{/other_user}","gists_url":"https://api.github.com/users/ianblenke/gists{/gist_id}","starred_url":"https://api.github.com/users/ianblenke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianblenke/subscriptions","organizations_url":"https://api.github.com/users/ianblenke/orgs","repos_url":"https://api.github.com/users/ianblenke/repos","events_url":"https://api.github.com/users/ianblenke/events{/privacy}","received_events_url":"https://api.github.com/users/ianblenke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-20T15:06:53Z","updated_at":"2015-07-20T18:06:39Z","closed_at":null,"body":"While trying to deploy an environment using docker-compose, we ran into a unique issue with resolv.conf that seems odd.\r\n\r\nWhen running `docker-compose up`, any container definitions that use a pre-build `image:` start up with the docker server's resolv.conf that is generated from passing `--dns` to the docker server when it starts. At the same time, any container defintions that use `build:` to do a `docker build` will inherit the docker host's `/etc/resolv.conf` file.\r\n\r\nOur particular use case was a developer that was rebuilding their ubuntu docker environment. The underlying ubuntu VM somehow had `nameserver 127.0.1.1` in its `/etc/resolv.conf`. A caching bind9 setup on that ubuntu VM resulted in name resolutions working on the ubuntu VM itself. The docker server wasn't being started with any `--dns` option, so it was inheriting this `resolv.conf`.  \r\n\r\nAttempting to run the docker server with `--dns 172.17.42.1` was not enough. While this did make it through to the `image:` containers started with `docker run`, it was blindly ignored by the `docker build`.\r\n\r\nThis means that the `docker build` steps were failing as unable to do DNS resolution, but the docker containers started with `docker run` were just fine.\r\n\r\nThis particular developer problem was experienced with docker 1.7.0 and docker-compose 0.3.0 on an Ubuntu VM under VMWare on a Windows host.\r\n\r\nOur workaround was to modify the Ubuntu VM's `/etc/resolv.conf` to `nameserver 172.17.42.1` so that the `docker build` steps would use that.\r\n\r\nCall me crazy, but this sure seems like a bug.\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/122970268","html_url":"https://github.com/docker/docker/issues/14755#issuecomment-122970268","issue_url":"https://api.github.com/repos/docker/docker/issues/14755","id":122970268,"user":{"login":"mrjana","id":1693482,"avatar_url":"https://avatars.githubusercontent.com/u/1693482?v=3","gravatar_id":"","url":"https://api.github.com/users/mrjana","html_url":"https://github.com/mrjana","followers_url":"https://api.github.com/users/mrjana/followers","following_url":"https://api.github.com/users/mrjana/following{/other_user}","gists_url":"https://api.github.com/users/mrjana/gists{/gist_id}","starred_url":"https://api.github.com/users/mrjana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrjana/subscriptions","organizations_url":"https://api.github.com/users/mrjana/orgs","repos_url":"https://api.github.com/users/mrjana/repos","events_url":"https://api.github.com/users/mrjana/events{/privacy}","received_events_url":"https://api.github.com/users/mrjana/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T18:06:39Z","updated_at":"2015-07-20T18:06:39Z","body":"@ianblenke Nameserver entries belonging to loopback ranges are intentionally removed when a container inherit's the host's `resolv.conf` file and in your particular case `--dns` option when running a container is not going to help since there is know way to pass these options during the build steps which internally run temporary docker containers to achieve these build steps. But fortunately the same `--dns` options are available as daemon options as well. So if it is possible for you to pass the same options as daemon options it will work for your use case."}}