Stuck trying to figure out what’s up with your containers, as they cannot seem to be able to access the network?
Well, that happened to a few of us at Namshi in the past couple of days.
The good news is that you can clearly verify
that something is just wrong with Docker by
simply pinging google.com
from your host
and a simple container:
1 2 3 4 5 6 7 8 |
|
If you happen to get stuck in this kind of situation, you might want to look into what DNS server Docker is actually using to let your containers resolve onto the internet.
In our case, we realized our firewall was
acting pretty weirdly with Google’s public
DNSes (8.8.8.8
and 8.8.4.4
), which happen
to be the default ones Docker is gonna use in
case you don’t have anything custom specified
in your resolv.conf
and so on.
The issue, overall, was quite easy to circumvent,
as we just told docker to use OpenDNS in our
/etc/default/docker
:
1 2 3 4 |
|
Then, you will only need to restart the Docker demon and everything should be fine:
1 2 3 4 5 6 7 8 9 |
|
Hope this helps! To be honest we’ve googled around and found out that there might be some other, creepier, issues that might cause the problem, so I’d really hope yours is just as silly as the one I’ve faced.