-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate PUT request during push of BuildKit-built image #5874
Comments
Let me transfer this to the buildx repository, as this looks to be an issue with BuildKit and/or buildx (the client used for |
@thaJeztah isn't the failing command here |
Oh! 🙈 You're right; I thought this was a |
Admittedly I myself am unsure where the issue lies - but the issue does seem to be at the point of push, rather than the build itself. |
Not sure yet! If you disable BuildKit, Docker uses the legacy builder, which produces a single-arch image (for the platform you're building for). With BuildKit and the containerd image store enabled, BuildKit produces a multi-platform image ("OCI Image Index") as well as attestations, SBOMS related to the image. My first thinking there is that it's not unlikely that pushing such an image would try a Possibly the registry in this case is configured for immutable tags, therefore not accepting. It might be worth trying if building without attestations works around the problem (which would narrow down things); |
Using
|
Description
Our upstream container repository provider (Oracle Cloud) reports that they are seeing duplicated requests during the push of an image, and thus are serving a 409 Conflict response on the second request.
The requests occur only during the initial push of a new tag on an image built with buildkit (the default in the version of Docker I am running), and not when the legacy builder is used.
Successive calls to push the same tag work, however new tags on an existing repository exhibit the same behaviour.
We have found that older versions of the docker CLI (we have tested up to Docker Engine v26.0.0) work without this issue.
Pushing to Docker Hub works as expected.
Reproduce
Dockerfile
text.txt
is a simple text file with "Hello World" insideFailing request
docker build -t lhr.ocir.io/<redacted>/ocir-test:buildx-test .
Observe the build successfully complete
docker push lhr.ocir.io/<redacted>/ocir-test:buildx-test
Observe a 409 error:
failed commit on ref "manifest-sha256:fcd195ebabd830937ca77cbe21c9ddbe3499c4517d211ca5c3fcd6d9931a8a10": unexpected status from PUT request to https://lhr.ocir.io/v2/<redacted>/ocir-test/manifests/buildx-test: 409 Conflict
Successful request
DOCKER_BUILDKIT=0 docker build -t lhr.ocir.io/<redacted>/ocir-test:legacy-test .
Observe the build successfully complete
docker push lhr.ocir.io/<redacted>/ocir-test:legacy-test
Observe the push successfully complete
Expected behavior
docker push
of a BuildKit-built image should not produce duplicate requests during the push of the image to the container registry.docker version
Client: Version: 27.5.1 API version: 1.47 Go version: go1.22.11 Git commit: 9f9e405 Built: Wed Jan 22 13:37:19 2025 OS/Arch: darwin/arm64 Context: desktop-linux Server: Docker Desktop 4.38.0 (181591) Engine: Version: 27.5.1 API version: 1.47 (minimum version 1.24) Go version: go1.22.11 Git commit: 4c9b3b0 Built: Wed Jan 22 13:41:25 2025 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.7.25 GitCommit: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e946 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: