moby: Can't push multiple images to same repo in parallel
Attempting to push multiple images to the same remote in parallel cases one of the push operations to fail. The operation claims “is already in progress”, implying that the image is already being pushed, but this is false. The image is not pushed, and pushing again at a later time will end up actually pushing the image.
$ cat > Dockerfile <<'EOF'
FROM fedora:20
ADD file /file
RUN dd if=/dev/zero of=zero bs=1M count=10
EOF
$ echo 1 > file
$ docker build -t phemmer/test:1 .
$ echo 2 > file
$ docker build -t phemmer/test:2 .
$ docker push phemmer/test:1 & docker push phemmer/test:2 ; wait
[1] 31920
The push refers to a repository [phemmer/test] (len: 1)
Sending image list
2014/11/12 20:38:02 Error: push phemmer/test is already in progress
[1] + exit 1 docker push phemmer/test:1
Pushing repository phemmer/test (1 tags)
511136ea3c5a: Image already pushed, skipping
c69cab00d6ef: Image already pushed, skipping
88b42ffd1f7c: Image already pushed, skipping
64dd2ddab00b: Image successfully pushed
712a4eb2c2eb: Image successfully pushed
Pushing tag for rev [712a4eb2c2eb] on {https://cdn-registry-1.docker.io/v1/repositories/phemmer/test/tags/2}
In this case, the phemmer/test:2
image successfully pushed, but phemmer/test:1
failed.
Docker version 1.3.1
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 28 (18 by maintainers)
Commits related to this issue
- Allow concurrent pushes within the same repository This change brings push behavior in line with pulling. If the requested push matches one already in progress (same tag, if any), show the progress o... — committed to aaronlehmann/docker by aaronlehmann 9 years ago
- Allow concurrent pushes within the same repository This change brings push behavior in line with pulling. If the requested push matches one already in progress (same tag, if any), show the progress o... — committed to aaronlehmann/docker by aaronlehmann 9 years ago
- Fix concurrent uploads that share layers Concurrent uploads which share layers worked correctly as of #18353, but unfortunately #18785 caused a regression. This PR removed the logic that shares diges... — committed to aaronlehmann/docker by aaronlehmann 8 years ago
- Fix concurrent uploads that share layers Concurrent uploads which share layers worked correctly as of #18353, but unfortunately #18785 caused a regression. This PR removed the logic that shares diges... — committed to tiborvass/docker by aaronlehmann 8 years ago
Not sure if this has been mentioned, but the most obvious workaround is
You can probably tune it further so that the lock is per repo, e.g.
/var/lock/docker-pool-${repo}
.