Docker build: unable to fetch archives

2019-09-14 10:16发布

问题:

I'm using docker toolbox on my Windows machine. I'm trying to build this project from github https://github.com/pyannote/pyannote-video. When I build an image by running docker build -t pyannote/video ., I get the following error:

Get:17 http://archive.ubuntu.com/ubuntu/ trusty-updates/main python-setuptools all 3.3-1ubuntu2 [230 kB]
Err http://archive.ubuntu.com/ubuntu/ trusty-updates/universe python-pip all 1.5.4-1ubuntu3
  404  Not Found [IP: 91.189.88.149 80]
Fetched 1658 kB in 21s (78.5 kB/s)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python-pip-whl_1.5.4-1ubuntu3_all.deb  404  Not Found [IP: 91.189.88.1
9 80]

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python-pip_1.5.4-1ubuntu3_all.deb  404  Not Found [IP: 91.189.88.149 8
]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends     python     python-dev     python-pip' returned
a non-zero code: 100

I checked on http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/. There is python-pip_1.5.4-1ubuntu4_all.deb instead of python-pip_1.5.4-1ubuntu3_all.deb.

The output is asking me to run apt-get update or try with --fix-missing, but I'm running docker on Windows. Run apt-get will return command not found. What should I do to fix this?

回答1:

Edit the Dockerfile and change line 5 from this:

RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \

to this:

RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -yq --no-install-recommends \
                                   ^ Add this part ^

Then tell whoever wrote that Dockerfile to read this.



标签: ubuntu docker