Docker-从Docker仓库拉取失败(EOF/403),但从RH仓库下载成功

5

系统信息: RHEL 7.1(全新安装) Docker 1.6.2 我们使用Red Hat提供的“奖励”DVD中的Docker rpm。

问题: 当我通过docker拉取镜像时,只有在Red Hat仓库上才能正常工作。

# docker pull openshift3/mysql-55-rhel7
Trying to pull repository registry.access.redhat.com/openshift3/mysql-55-rhel7 
...
bb8bf2124de9: Download complete
65de4a13fc7c: Download complete
85400654aa47: Download complete
c537da9944e0: Download complete
6d97b1e161bb: Download complete
0d0dc8d923d6: Download complete
e4ba106b746b: Download complete
Status: Downloaded newer image for registry.access.redhat.com/openshift3/mysql-55-rhel7:latest

当我从Docker仓库中拉取镜像时,它失败了。但是 - 在我看来真的很奇怪 - 出现了不同的错误。
首先我拉取了 httpd 镜像。
# docker pull httpd
Trying to pull repository registry.access.redhat.com/httpd ... not found latest: Pulling from docker.io/httpd
64e5325c0d9d: Pulling fs layer
bf84c1d84a8f: Download complete
6c1a7f5286ab: Download complete
…
ee4d515e8896: Download complete
de94ed779434: Download complete
de94ed779434: **Error pulling image (latest) from docker.io/httpd, ApplyLayer exit status 1 stdout:  stderr: unexpected EOF**
FATA[0040] Error pulling image (latest) from docker.io/httpd, ApplyLayer exit status 1 stdout:  stderr: unexpected EOF

然而,拉取hello-world会产生以下结果

# docker pull hello-world
Trying to pull repository registry.access.redhat.com/hello-world ... not found
latest: Pulling from docker.io/hello-world
a8219747be10: Pulling fs layer
a8219747be10: Error pulling dependent layers
91c95931e552: Error pulling image (latest) from docker.io/hello-world,  Server error: Status 403 while fetching image layer (a821974FATA[0010] Error pulling image (latest) from docker.io/hello-world, Server error: Status 403 while fetching image layer (a8219747be10611d65b7c693f48e7222c0bf54b5df8467d3f99003611afa1fd8)

我在企业网络上,按照这篇博客中关于代理和证书的方法进行了设置,使其成功运行。


我们追踪了错误并将 https://*.cloudfront.net/registry-v2/docker/registry/v2/* 添加到代理规则中。Docker 存储镜像的其他 URL 是否还有? - Koen Vingerhoets
听起来你们的IT安全团队认为玩白名单游戏就足以证明他们有领取薪水的理由。可以说,Docker Hub注册表存储的位置是一项实现细节,而不是合同细节。依赖于实现细节是脆弱且容易出错的。愚蠢的游戏,愚蠢的奖品。 - Chris Becke
3个回答

3
service docker stop

rm -r /var/lib/docker/*

service docker start

对我有用。请注意,这很可能会清除Docker。


0

有几件事情可以帮助你缓解这个问题:

  1. 如果在从私有仓库拉取大型镜像时遇到此错误,可能意味着私有仓库很忙,因为可能有其他人同时在拉取。
  2. 如果你正在拉取的镜像大小很大,而你的机器性能较低,即使你从公共仓库拉取也可能出现此问题。
  3. 如果以上都不适用于你,那么我认为你遇到了 Docker 1.7 的一个奇怪的 bug,最好的解决方法是将客户端版本升级到 1.11 或更高版本。

0

当我拉取一个大于2GB的镜像时,我也遇到了unexpected EOF。然而,对我们来说,解决方法是增加文件系统的大小,这样在将图像移动到docker守护程序存储它们之前,可以缓存传入的图像。

听起来与这个问题的真正问题无关,但对于其他人在未来检查时可能会有用。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接