Recently I've experienced strange issues with networking inside of Docker containers - like being unable to ping google.com
from inside a container, and all of the common suggestions around DNS resolution
not helping.
It turns out that Docker will copy your computer's default DNS settings into a container. If you change your DNS settings at some point - either manually or because your machine accepts defaults from your router/provider - the settings inside your cached Docker layers may no longer match what's on your machine, and certain DNS resolutions will fail in unusual ways.
My fix: docker run -it {image} /bin/bash
manually (for example, docker run -it python:2.7 bash
) to find the root image that is unable to resolve the domain you're interested
in, and then remove the culprit with docker rmi {hash}
.