Skip to content

Instantly share code, notes, and snippets.

@dyndna
Created May 20, 2015 21:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dyndna/12b2317b5fbade37e747 to your computer and use it in GitHub Desktop.
Save dyndna/12b2317b5fbade37e747 to your computer and use it in GitHub Desktop.
Docker build "Could not resolve 'archive.ubuntu.com'" apt-get fails to install anything

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]

  1. 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"

  1. Restart docker by sudo service docker restart or service restart command for other platforms.
  2. 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/

Tested OK in Linux 3.13.0-45-generic #74~precise1-Ubuntu SMP Thu Jan 15 20:21:55 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment