Docker拉“意外的EOF" [英] Docker pull “unexpected EOF”

查看:1424
本文介绍了Docker拉“意外的EOF"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个与码头工人有关的问题. 场景是这样的:我们使用Codebuild + Packer + docker创建AMI,并在部署中使用它.在此步骤中,我们从工件中拉出图像,并且除了拉出其中一层> 1Gb的层以外,其他所有过程均正常进行.重试几次后,失败并显示以下错误:下载失败,重试:未知的Blob,然后出现意外的EOF".您曾经遇到过这样的问题吗?任何意见或建议都将受到高度赞赏.

I faced an issue with the docker. The scenario is like this: we use Codebuild+Packer+docker to create AMI, which is used in deploy. During this step we pull image from artifactory and all pass fine except pulling one of the layers which is > 1Gb. After several retries it fails with error: Download failed, retrying: unknown blob and then "unexpected EOF". Have you ever faced such issue? Any comments or advices are highly appreciated.

推荐答案

我遇到了一个非常小的层的问题,该层由于某种未知的原因在注册表V2中已损坏或损坏.重试图层后,docker pull失败,并显示意外的EOF"(在这种情况下,标识为"1f8fd317c5a4".)

I had this problem with a very small layer that was corrupted or broken in the registry V2 for some unknown reason. docker pull failed with "unexpected EOF" after retrying the layer (identified as "1f8fd317c5a4" in this case).

从源头重建图像并尝试docker push说图层已存在",但没有解决问题.

Rebuilding the image from source and trying to docker push said "layer already exists", not fixing the issue.

我能够使用curl删除有问题的图层;

I was able to delete the offending layer using curl like so;

curl -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' -sk "https://registry.local/v2/image-name/manifests/1033-develop-7e414712"

(将注册表替换为"registry.local",将图像名称替换为"image-name",并将图像标签或"latest"替换为"1033-develop-7e414712".)

(substitute your registry for "registry.local", your image name for "image-name", and your image tag or "latest" for "1033-develop-7e414712".)

从JSON输出中获取第1f8fd317c5a4层的完整sha256摘要,并在下一个命令中使用它:

Get the complete sha256 digest for layer 1f8fd317c5a4 from the JSON output, and use it in next command:

curl -k -X DELETE "https://registry.local/v2/image-name/blobs/sha256:1f8fd317c5a406a75130dacddc02bd09a9abf44e068e2730dd8f5238666bb390"

现在,您将可以docker push registry.local/image-name:1033-develop-7e414712上传已删除的图层,一切正常.

Now you will be able to docker push registry.local/image-name:1033-develop-7e414712 to upload the layer you deleted, and everything works.

这篇关于Docker拉“意外的EOF"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆