我的dockerfile
FROM node:argon
# Set the locale
RUN apt-get clean && apt-get update
RUN apt-get install locales
RUN locale-gen en_US.UTF-8
10次中的9次,无法使用以下错误构建。
Sending build context to Docker daemon 73.95 MB
Step 1 : FROM node:argon
---> 10a26800d95a
Step 2 : RUN apt-get clean && apt-get update
---> Running in 5a41dd8ab15e
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Get:2 http://security.debian.org jessie/updates/main amd64 Packages [390 kB]
Ign http://httpredir.debian.org jessie InRelease
Err http://httpredir.debian.org jessie Release.gpg
Error reading from server. Remote end closed connection [IP: 5.153.231.35 80]
Get:3 http://httpredir.debian.org jessie-updates InRelease [142 kB]
Err http://httpredir.debian.org jessie-updates/main amd64 Packages
Get:4 http://httpredir.debian.org jessie Release [148 kB]
Err http://httpredir.debian.org jessie-updates/main amd64 Packages
Get:5 http://httpredir.debian.org jessie/main amd64 Packages [9064 kB]
Err http://httpredir.debian.org jessie-updates/main amd64 Packages
Err http://httpredir.debian.org jessie-updates/main amd64 Packages
404 Not Found [IP: 5.153.231.35 80]
Fetched 9808 kB in 15s (615 kB/s)
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/Release.gpg Error reading from server. Remote end closed connection [IP: 5.153.231.35 80]
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages 404 Not Found [IP: 5.153.231.35 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
The command '/bin/sh -c apt-get clean && apt-get update' returned a non-zero code: 100
没有任何改变,任何想法?
答案 0 :(得分:2)
我多次构建你的Dockerfile没有问题。尝试重新启动Docker服务/实例/计算机。
您可能遇到网络问题,因为问题是间歇性的。
答案 1 :(得分:1)
您的Dockerfile在我的机器上运行良好。我猜这是由网络连接引起的。因此,请检查您是否在防火墙后面,以及是否需要设置代理才能访问Internet。如果是这样,请在RUN apt-get
命令前面的Dockerfile中添加此命令以设置代理ENV http_proxy 'http://<server-address>:<port>'
答案 2 :(得分:0)
这发生在我身上只是因为我的系统时钟过去(未同步)的简单原因。修复时间使此错误消失。