it seems to me that docker for mac does not use the internal OS X DNS service for retrieving information about DNS. At work we are using Cisco VPN and the OS X client AnyConnect. This client does not modify /etc/resolv.conf rather it uses the internal OS X servcies for configuring DNS. This works quite well for many applications, but docker for mac fails.
Expected behavior
Docker should recognize DNS settings if used in conjunction with VPN clients.
Actual behavior
It doesn’t. I can’t pull images from our private registry and Im also not able to ping services from inside a container.
$ docker pull internal.dockerreg.lan/myimage
Using default tag: latest
Pulling repository internal.dockerreg.lan/myimage
Error while pulling image: Get http://internal.dockerreg.lan/v1/repositories/myimage/images: dial tcp: lookup internal.dockerreg.lan on 192.168.65.1:53: no such host
root@9b8355683444:/# ping internal.dockerreg.lan
ping: unknown host
Im able to solve this problem if I add the output (resolver section) from scutil --dns to /etc/resolv.conf, but this file is regenerated on every restart.
Information
Docker for Mac: version: mac-v1.12.0-beta16.2
OS X: version 10.11.5 (build: 15F34)
logs: /tmp/20160627-081233.tar.gz
failure: No error was detected
[OK] docker-cli
[OK] app
[OK] menubar
[OK] virtualization
[OK] system
[OK] osxfs
[OK] db
[OK] slirp
[OK] moby-console
[OK] logs
[OK] vmnetd
[OK] env
[OK] moby
[OK] driver.amd64-linux
[details=self-test]Docker for Mac: version: mac-v1.12.0-beta16.2
OS X: version 10.11.5 (build: 15F34)
logs: /tmp/20160627-184018.tar.gz
failure: No error was detected
[OK] docker-cli
[OK] app
[OK] menubar
[OK] virtualization
[OK] system
[OK] osxfs
[OK] db
[OK] slirp
[OK] moby-console
[OK] logs
[OK] vmnetd
[OK] env
[OK] moby
[OK] driver.amd64-linux
[/details]
confirmation
$ docker exec -it isvc bash
root@isvc:/# ping google.com
ping: unknown host google.com
root@isvc:/# ping redis
PING redis (172.19.0.2) 56(84) bytes of data.
64 bytes from redis.itemservice_default (172.19.0.2): icmp_seq=1 ttl=64 time=0.096 ms
64 bytes from redis.itemservice_default (172.19.0.2): icmp_seq=2 ttl=64 time=0.052 ms
^C
— redis ping statistics —
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.052/0.074/0.096/0.022 ms
I’d rather say that from inside my containers I can’t get resources from the Internet at all…
Previously (before 1.12) that issue has appeared accidentally from time to time. My workaround was to restart Docker app, but in the current version that doesn’t work anymore.
;(