Edit 2020: This is a six year old question. I never figured out how to fix this specific problem back then, but Docker and everything else involved moved on. SE doesn't allow me to delete my question, but it's not relevant anymore.
I have a new Ubuntu 14.04 install, and want to use Docker to run my old stuff that needs 12.04. DNS inside Docker doesn't work.
My laptop's resolv.conf looks like:
Which doesn't work with Docker, apparently. It therefore tries to set the nameservers to 188.8.131.52 and 184.108.40.206; when I do
$ sudo docker run -i -t ubuntu /bin/bash
WARNING: Local (127.0.0.1) DNS resolver found in resolv.conf and containers can't use it. Using default external servers : [220.127.116.11 18.104.22.168]
And sure enough, inside the Docker instance, resolv.conf looks like:
nameserver 22.214.171.124 nameserver 126.96.36.199
I can ping both of those successfully from within the Docker instance. However, there is no DNS (e.g.,
ping google.com fails).
ifconfig output inside Docker:
eth0 Link encap:Ethernet HWaddr aa:e9:9f:83:9d:92 inet addr:172.17.0.2 Bcast:0.0.0.0 Mask:255.255.0.0 inet6 addr: fe80::a8e9:9fff:fe83:9d92/64 Scope:Link UP BROADCAST RUNNING MTU:1500 Metric:1 RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:648 (648.0 B) TX bytes:738 (738.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)