3

I have a problem when trying to run docker build. This is the command I run:

docker build -t <name> .

The Dockerfile contains the following first lines:

FROM ubuntu:xenial
RUN apt-get -y update
RUN apt-get -y install --fix-missing \
    sudo \
    git 

When building it though, I get the following error messages:

Unable to correct missing packages.
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/perl/perl-modules-5.22_5.22.1-9ubuntu0.2_all.deb  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/perl/libperl5.22_5.22.1-9ubuntu0.2_amd64.deb  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/perl/perl_5.22.1-9ubuntu0.2_amd64.deb  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/i/ifupdown/ifupdown_0.8.10ubuntu1.2_amd64.deb  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.11_amd64.deb  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.0.2g-1ubuntu4.11_amd64.deb  404  Not Found [IP: 91.189.88.152 80]
E: Aborting install.
The command '/bin/sh -c apt-get -y install --fix-missing     sudo     git' returned a non-zero code: 100

It works fine on my friend's computer, but continues to crash on mine every time I try again. I am using docker version 18.03.1-ce and Ubuntu 16.04.4, everything is up-to-date, and I honestly have no idea at all what is going wrong...

Kalle Richter
  • 6,180
  • 21
  • 70
  • 103
Kara
  • 31
  • 1
  • 1
  • 2

2 Answers2

1

I have seen this error which I solved by giving docker build parm --no-cache as in

docker build -t <name> --no-cache  .

then after this builds correctly you are free to remove parm --no-cache for subsequent builds to speed up the build

0

Docker's instructions say to place the update and install on the same line.

I also found that I could only use a plain old "RUN" command and that "ONBUILD" caused problems.

  • 1
    How can this explain the inability to fetch? Update and install on the same line is intended to keep the image size down. – Stephen Rauch Jul 27 '18 at 21:29