I managed to find out this problem. On Ubuntu, Docker installs the DNS servers for the container on Google servers at 8.8.8.x. As far as I understand, this is a workaround for Ubuntu due to the fact that Ubuntu sets /etc/resolv.conf as 127.0.0.1.
These Google servers were not available due to our firewall, so we were not able to resolve any URLs.
The fix is โโto tell Docker which DNS servers to use. It depends on how you installed Docker:
Ubuntu package
If you have the Ubuntu package installed, edit the / etc / default / docker file and add the following line:
DOCKER_OPTS="--dns <your_dns_server_1> --dns <your_dns_server_2>"
You can add as many DNS servers as you want. After you have edited this file, you need to restart the Docker service:
sudo service docker restart
Binary
If you installed Docker through the binary method (i.e. there is no package), then you will install DNS servers when the Docker daemon starts:
sudo docker -d -D --dns <your_dns_server_1> --dns <your_dns_server_2> &
dsw88 Jun 12 '14 at 4:46 a.m. 2014-06-12 16:46
source share