Recently I installed docker 1.13.1 on my new windows 10 machine, I needed to pull a image from a private repo which recently relocated and our dns server still had the old ip. With docker toolbox I used to be able to docker-machine ssh into the daemon and change the /etc/hosts file to hard-code a temporary ns mapping. Since there is no direct access provided to the new moby daemon I had to use this hack from the forum to get into it:
docker run -it --rm --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh
I changed /etc/hosts in moby but when I do a pull it still uses the wrong ip from our internal dns, I had to change the docker dns to something like 188.8.131.52 where the repo hostname doesn’t exit at all, only then the pull would resolve to the hard-coded ip in /etc/hosts.
So I guess there are 2 issues I want to raise here, first please provide default access to the daemon, I think there is really no point in hiding it, people who need it need it (for debugging issues etc.), and there are ways to hack into it anyway.
Secondly I think it’s a bug that dns lookup taking precedence over /etc/hosts (btw it would be nice if you can auto copy the windows hosts file into the daemon)