似乎apt-get与存储库服务器的连接存在问题。我想这可能是兼容性问题,正如前面提到的这里,但是apt-get clean的拟议解决方案对我不起作用。而且我也很惊讶,如果是这样的话,没有更多的人有我的问题。
米维
Dockerfile 来自debian:jessie运行apt&get&apt get更新& apt-get install -y --非安装-推荐\ git
$ docker build .
docker build .
Sending build context to Docker daemon 2.048 kB
Step 0 : FROM debian:jessie
---> 4a5e6db8c069
Step 1 : RUN apt-get clean && apt-get update && apt-get install -y --no-install-recommends git
---> Running in 43b93e93feab
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
... some omitted ...
Get:6 http://httpredir.debian.org jessie-updates/main amd64 Packages [3614 B]
Fetched 9552 kB in 7s (1346 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
... some omitted ...
0 upgraded, 26 newly installed, 0 to remove and 0 not upgraded.
Need to get 13.2 MB of archives.
After this operation, 64.0 MB of additional disk space will be used.
Get:1 http://security.debian.org/ jessie/updates/main libgnutls-deb0-28 amd64 3.3.8-6+deb8u2 [694 kB]
... some omitted ...
Get:5 http://httpredir.debian.org/debian/ jessie/main libnettle4 amd64 2.7.1-5 [176 kB]
Err http://httpredir.debian.org/debian/ jessie/main libffi6 amd64 3.1-2+b2
Error reading from server. Remote end closed connection [IP: 176.9.184.93 80]
... some omitted ...
Get:25 http://httpredir.debian.org/debian/ jessie/main git amd64 1:2.1.4-2.1 [3624 kB]
Fetched 13.2 MB in 10s (1307 kB/s)
E: Failed to fetch http://httpredir.debian.org/debian/pool/main/libf/libffi/libffi6_3.1-2+b2_amd64.deb Error reading from server. Remote end closed connection [IP: 176.9.184.93 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c apt-get clean && apt-get update && apt-get install -y --no-install-recommends git' returned a non-zero code: 100请注意,我也发布了一个不同的问题的这里。我相信这是不相关的,但很可能实际上是这样。
发布于 2015-08-31 07:43:35
httpredir.debian.org镜像是“神奇的”,因为它将负载平衡和geo透明,提高性能和可用性。因此,我立即怀疑这是造成你的问题,或至少是第一件事排除。
我会检查你是否可以:
httpredir.debian.org会从内部列表中抛出“坏”镜像,因此您的问题可能是暂时的。httpredir.debian.org镜像再现问题.试试像ftp.de.debian.org这样的东西。如果它与此镜像一起工作,请与httpredir.debian.org维护者联系并向他们报告问题。它们具有很强的响应性,并对bug报告开放。发布于 2016-05-25 02:42:17
对于有此问题的人,这是我在构建Dockerfile时用单个工作域交换httpredir来“修复”问题的尝试:
FROM debian:je...
# Insert this line before "RUN apt-get update" to dynamically
# replace httpredir.debian.org with a single working domain
# in attempt to "prevent" the "Error reading from server" error.
RUN sed -i "s/httpredir.debian.org/`curl -s -D - http://httpredir.debian.org/demo/debian/ | awk '/^Link:/ { print $2 }' | sed -e 's@<http://\(.*\)/debian/>;@\1@g'`/" /etc/apt/sources.list
# Continue with your apt-get update...
RUN apt-get update...这个命令所做的是:
http://httpredir.debian.org/demo/debian/以从debian演示页面获取标题(-s是静默的,不要输出)。-D是转储报头)Link标头片段。这包含了httpredir推荐的最佳路由。sed -e ...是在步骤2中提取链接的域名。/etc/apt/sources.list中找到的域/etc/apt/sources.list。这不是一个修复,而是一个简单的黑客(大幅度)减少失败的构建机会。还有..。如果看起来很奇怪,请原谅,因为这是我的处女膜和管道尝试。
编辑
另外,如果它选择的域太慢,或者响应不够,您可能需要手动执行。
http://......./debian/的链接。例如,在写作的时候,我看到了http://mirrors.tuna.tsinghua.edu.cn/debian/RUN sed -i....命令,而是使用以下命令:
运行sed -i -i/etc/apt/-i.列表发布于 2016-04-19 14:14:57
我在我的dockerfile中添加了apt-get clean,在apt-get update行之前,它似乎已经完成了这个任务。
我想我无法知道是否是额外的命令,或者是运气修复了我的构建,但我采纳了https://github.com/CGAL/cgal-testsuite-dockerfiles/issues/19的建议。
https://stackoverflow.com/questions/32304631
复制相似问题