I had trouble running a docker build because
Found these posts that explained why:
Reference1: http://stackoverflow.com/questions/24832972/docker-apt-get-update-fails
Reference2: http://stackoverflow.com/questions/24151129/docker-network-calls-fail-during-image-build-on-corporate-network
Quoting the solution:
On a linux host (ubuntu 16.10) you can do
apt-get updateand
apt-get -y install apache2won't work due to DNS resolution failures
Found these posts that explained why:
Reference1: http://stackoverflow.com/questions/24832972/docker-apt-get-update-fails
Reference2: http://stackoverflow.com/questions/24151129/docker-network-calls-fail-during-image-build-on-corporate-network
Quoting the solution:
Those Google servers weren't accessible from behind our firewall, which is why we couldn't resolve any URLs.And on a windows machine, you can run
The fix is to tell Docker which DNS servers to use. This fix depends on how you installed Docker:
Ubuntu Package
If you have the Ubuntu package installed, edit /etc/default/docker 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 to this config. Once you've edited this file you'll want to restart your Docker service:
sudo service docker restart
Binaries
If you've installed Docker via the binaries method (i.e. no package), then you set the DNS servers when you start the Docker daemon:
sudo docker -d -D --dns --dns &
ipconfig /allto find your DNS servers
On a linux host (ubuntu 16.10) you can do
nmcli device show <device>.
No comments:
Post a Comment