ubuntu Docker版本:无法获取存档

egdjgwm8  于 2022-11-02  发布在  Docker
关注(0)|答案(2)|浏览(138)

我正在Windows机器上使用Docker工具箱。我试图从github https://github.com/pyannote/pyannote-video构建这个项目。当我通过运行docker build -t pyannote/video .构建一个映像时,我得到了以下错误:

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

我在http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/上检查了一下。有一个python-pip_1.5.4-1ubuntu4_all.deb,而不是python-pip_1.5.4- 1ubuntu 3_all.deb.
输出要求我运行apt-get update或尝试使用--fix-missing,但我在Windows上运行的是docker。运行apt-get将返回未找到命令。我应该怎么做来修复这个问题?

x7yiwoj4

x7yiwoj41#

编辑Dockerfile并将第5行更改为:

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

更改为:

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

那就告诉写Dockerfile的人读这个。

sqxo8psd

sqxo8psd2#

我发现Docker通常会缓存apt-get update步骤,如果依赖项或它们的位置在此期间发生了变化,您的apt-get实际上并没有给您带来任何好处。运行带有--no-cache标志的docker build命令可以强制这些缓存的层运行,从而避免这种情况。

相关问题