0

Docker images are unable to connect to the internet. I am behind a corporate firewall, and have done the DNS stuff, in both /etc/default/docker and /etc/resolv.conf

However, I am not even able to access things in my local network. viz: docker run busybox ping -c 1 10.[remainder_of_host_network_ip] fails.

I have performed the steps for resetting the bridge described elsewhere:

pkill docker
iptables -t nat -F
ifconfig docker0 down
brctl delbr docker0
docker -d

EXCEPT for the docker -d bit, which seems to be deprecated. If anyone knows what that does, and how to do that now, that might help...

wireshark shows that the following packet just gets repeated a ton of times, and never really resolves:

43 60.451954286 02:42:ac:11:00:02 -> Broadcast    ARP 42 Who has 172.17.0.1? Tell 172.17.0.2

172.17.0.1 is my docker0 interface. I assume that 172.17.0.2 is the container.

Any thoughts on what is wrong?

migrated from stackoverflow.com Mar 23 '17 at 14:22

This question came from our site for professional and enthusiast programmers.

0

This iptables -t nat -F may be part of your issue.

You also unconfigured the docker bridge (ifconfig docker0 down) - which is why docker containers cannot find their gateway (172.17.0.1).

Normally, the docker bridge will be up (you set it down), and would have an IP of 172.17.0.1, which is the default gateway configured on containers.

Additionally, iptables -vnL -t nat should include a line like: 0 0 MASQUERADE all -- * !docker0 172.17.0.0/16 0.0.0.0/0

That ensures that hosts on your network see your host IP, rather than the individual docker container IPs.

Possibly the simplest thing to do is restart docker, relaunch your container, and check if that changes anything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.