Docker build "Could not resolve 'archive.ubuntu.com'" apt-get fails to install anything
In Ubuntu Precise 12.04 LTS, after executing docker build command, e.g., docker build -t myimages/pcawg3_1 -f ./icgc_rnaseq_align/
, build engine may halt at step 1: apt-get
with errors similar to Could not resolve 'archive.ubuntu.com'. This is occurring most likely because of inability of docker ubuntu image to resolve apt-get urls with default Google DNS.
To resolve this issue: [Ref. http://stackoverflow.com/a/24991137]
- Uncomment following line in
/etc/default/docker
, and preferably replace Google DNS with those from your own ISP:
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
- Restart docker by
sudo service docker restart
or service restart command for other platforms. - Reissue docker build, and add
no-cache=true
flag to force docker image fetch new DNS, e.g.,docker build --no-cache=true -t myimages/pcawg3_2 -f ./icgc_rnaseq_align/