0

I'm trying to build a Docker image, and are following the basic tutorial on Dockers own page. My Dockerfile looks like

FROM docker/whalesay:latest
RUN apt-get -y update && apt-get install -y fortunes
CMD /usr/games/fortune -a | cowsay

That is exact the same as Docker provide. I'm running linux mint 18, and Docker is installed. I'm able to run images, like hello-world or others that I've build earlier and pushed to docker hub. (Used windows when i created them)

If I try to create images that I've created earlier, the same thing happens. It always crashes when RUN apt-get -y update && apt-get -y install.

Do anyone know how to solve this problem?

Thanks!

Picture of error message

Andy
  • 15
  • 1
  • 4

1 Answers1

0

As per the image it fails to resolve "archive.ubuntu.com" do the following as per references.

  1. Uncomment the following line in /etc/default/docker
  2. DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
  3. Restart the Docker service sudo service docker restart
  4. Delete any images which have cached the invalid DNS settings.
  5. Build again and the problem should be solved.

Ref: Docker build "Could not resolve 'archive.ubuntu.com'" apt-get fails to install anything

Actual Ref: https://www.digitalocean.com/community/questions/docker-on-ubuntu-14-04-could-not-resolve-archive-ubuntu-com

Community
  • 1
  • 1
Senthil
  • 2,156
  • 1
  • 14
  • 19
  • Thanks! Had already commented that line. But had not deleted all containers. Know it works, again thanks! – Andy Sep 17 '16 at 07:41
  • Great Good keep going :) – Senthil Sep 17 '16 at 07:47
  • Problem has started again. The line in /etc/default/docker is commented, and I have deleted all images and restarted Docker with the sudo command. The error is the exact same as earlier, any further tips? – Andy Sep 21 '16 at 02:08
  • have you uncommented "DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4" in /etc/default/docker ? – Senthil Sep 21 '16 at 04:52