【发布时间】:2020-05-09 17:56:34
【问题描述】:
我正在我的 MacBook Pro 上进行 docker 构建,但它总是失败并出现以下错误:
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
zip
The following NEW packages will be installed:
unzip
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 170 kB of archives.
After this operation, 547 kB of additional disk space will be used.
Err:1 http://deb.debian.org/debian stretch/main amd64 unzip amd64 6.0-21+deb9u1
404 Not Found
E: Failed to fetch http://deb.debian.org/debian/pool/main/u/unzip/unzip_6.0-21+deb9u1_amd64.deb 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c apt-get install unzip' returned a non-zero code: 100
码头工人版本: Docker 版本 19.03.8,构建 afacb8b
MacOS:莫哈韦 10.14.6
Dockerfile sn-p:
FROM debian:latest
RUN apt-get update
RUN apt-get install -y ca-certificates
RUN apt-get install unzip
在我们使用 docker-ce=17.09.0~ce-0~ubuntu 的 travis CI 中构建工作正常
关于如何进一步调试它有什么建议吗?最初我们认为这可能是 debian 方面的临时问题,但问题一直存在,很可能是我的环境问题。
【问题讨论】:
-
将三个
apt-get命令组合成一个RUN命令有帮助吗?docker build输出是否在您引用的内容上方包含“使用缓存”行? -
Sending build context to Docker daemon 91.25MB Step 1/10 : FROM debian:latest ---> 8d31923452f8 Step 2/10 : RUN apt-get update---> 使用缓存 ---> 3140f7361780