Gil*_*lly 10 debian apt-get docker
似乎apt-get在连接存储库服务器时遇到问题.我想这是有可能的兼容性问题,如提到这里,但所提出的解决方案apt-get clean对我不起作用.另外,我很惊讶,如果是这样的话,没有更多的人有我的问题.
Dockerfile
Run Code Online (Sandbox Code Playgroud)FROM debian:jessie RUN apt-get clean && apt-get update && apt-get install -y --no-install-recommends \ 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
Run Code Online (Sandbox Code Playgroud)
请注意,我也在这里发布了另一个问题.我认为这是无关的,但实际上可能是.
Lio*_*han 12
对于遇到此问题的人,这是我尝试通过httpredir在构建Dockerfile时使用单个工作域进行交换来"修复"该问题:
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...
Run Code Online (Sandbox Code Playgroud)
这个命令的作用是:
http://httpredir.debian.org/demo/debian/从建筑机器卷曲以从debian演示页面获取标题(-s是静音,不输出.-D是转储标题)Link标题片段.这包含httpredir建议的最佳路线.sed -e ...是在步骤2中提取出链接的域名.httpredir.debian.org找到的域/etc/apt/sources.list.这不是一个修复,而是一个简单的黑客(大大)减少构建失败的机会.并且......请原谅我,如果它看起来很奇怪,因为这是我的处女sed和管道尝试.
另外,如果它选择的域太慢或没有响应,你可能想要手动执行
访问http://httpredir.debian.org/demo.html,您应该会看到类似的链接http://......./debian/.例如,在写作时,我看到了http://mirrors.tuna.tsinghua.edu.cn/debian/
而不是长RUN sed -i....命令,而是使用它:
RUN sed -i "s/httpredir.debian.org/mirrors.tuna.tsinghua.edu.cn/" /etc/apt/sources.list
Run Code Online (Sandbox Code Playgroud)该httpredir.debian.org镜是"神奇",因为它会负载平衡和地理-IP你透明提高性能和可用性.因此,我会立即怀疑它会导致您的问题,或者至少是第一个要排除的问题.
我会检查你是否可以:
仍然重现问题; httpredir.debian.org将从其内部列表中抛出"坏"镜像,因此您的问题可能是暂时的.
使用不同的非httpredir.debian.org镜像重现问题.尝试类似的东西ftp.de.debian.org.如果它适用于此镜像,请与httpredir.debian.org维护人员联系并向他们报告问题.他们非常敏感,对bug报告持开放态度.
apt-get clean我在行前加入了我的dockerfile apt-get update,似乎已经完成了这个伎俩.
我想我无法知道它是否是额外的命令,或者是否运气修复了我的构建,但我接受了来自https://github.com/CGAL/cgal-testsuite-dockerfiles/issues/的建议19
| 归档时间: |
|
| 查看次数: |
3389 次 |
| 最近记录: |