I faced an issue with 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.
This was mainly because of weak network ( as I was using mobile hotspot )
configured the docker daemon to reduce the tcp packets
$ dockerd --max-concurrent-downloads <int>
here <int> suggests the number of docker pull layers you want to download concurrently.
default is 3
in mycase i had set to 2
$ dockerd --max-concurrent-downloads 2 &>/dev/null
downside of doing this is sacrificing your precious time :)
takes time like hell
With Docker Desktop on Windows, could not find the dockerd
command, then added the below entry in the daemon.json
file and restarted the docker service.
"max-concurrent-downloads": 1
You will find this file at path- C:\Users\<user-name>\.docker\daemon.json
.
This will pull the layers in a sequential manner hence it will take time, but yes, this is an alternative solution to download the large image file over the weak network connection.
dockerd
command. –
Amphigory 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).
Rebuilding the image from source and trying to docker push
said "layer already exists", not fixing the issue.
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"
(substitute your registry for "registry.local", your image name for "image-name", and your image tag or "latest" for "1033-develop-7e414712".)
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"
Now you will be able to docker push registry.local/image-name:1033-develop-7e414712
to upload the layer you deleted, and everything works.
Had the same issue due to a bad connection. In the documentation, here is the dockerd command.
For Linux, simply add:
$ dockerd --max-concurrent-downloads 2
$ dockerd --max-download-attempts 10
For windows docker desktop, open settings -> Docker Engine and pop the following in with the numbers best for you. You can see all the options in the docs as above.
Stop docker service:
sudo service docker stop
Run docker service with decreasing
max-concurrent-downloads
to what suits your internet bandwidth (Unfortunately 1 for me) and increasingmax-download-attempts
:sudo dockerd --max-concurrent-downloads 1 --max-download-attempts 10
PS: I am not a docker expert. But, I believe there is a better way to do it by adding some config whether to the registry or your docker client.
Problem: Unable to pull docker image its giving retrying to pull image and EOF Solution: Update docker software then try to pull image it resolves the issue.
This does not match the situation described by OP perfectly, but I'll post it here for future reference. Docker Desktop 4.15.0 introduced a bug which caused a similar issue for me. Depending on the Docker Desktop version and command used, one of these errors would pop up:
% docker pull alpine:3.7
Error response from daemon: Get "https://registry-1.docker.io/v2/": read tcp 192.168.65.4:55694->192.168.65.5:3128: read: connection reset by peer
% docker-compose up --build
// Some stuff
=> ERROR [container_name internal] load metadata for docker.io/library/alpine:3.7 0.0s
------
> [container_name internal] load metadata for docker.io/library/alpine:3.7:
------
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to do request: Head "https://registry-1.docker.io/v2/library/alpine/manifests/3.7": unexpected EOF
% docker pull alpine:3.7
Error response from daemon: Get "https://registry-1.docker.io/v2/": unexpected EOF
The solution was to uninstall Docker Desktop and install an older version. I'm posting this here since a lot of guides and instructions recommend updating Docker Desktop to its newest version, but in my case that is exactly what caused the issue. Of course this bug will most likely be patched in a newer version at some point, I have notified Docker support about it.
Edit: It seems that there is a GitHub topic for my issue.
After so many trails, here is what worked for me
- Deleted the image in container registry repo.
- Rebuild image with --no-cache option and pushed again to container registry repo.
docker build --no-cache -t
© 2022 - 2024 — McMap. All rights reserved.
apt-get install build-essential
". – Anomalyartifactory
, but with the docker registry, check out this answer. – Meantime