Conversation
… unknown Docker 23+ BuildKit uses single-post upload (POST /blobs/uploads/?digest=...) for small blobs like the image config. The registry was returning 400 UNSUPPORTED, which containerd treated as a non-retryable failure and silently skipped the blob, leaving the config unreferenced in repository_blobs and causing unknown blob on pull. - Handle single-post upload in BlobsUploadStart: read body, verify digest, store blob - Add ON CONFLICT DO NOTHING to repository_blobs insert for idempotency - Fix missing return statements in BlobsDownload after error handling - Track byte count in UploadCompleteBlob to populate blob size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /v2/.../blobs/uploads/?digest=sha256:...with the blob body inline) for small blobs such as the image config. The registry was returning400 UNSUPPORTED, which containerd silently treated as a skip, leaving the config blob offrepository_blobsand causingunknown blobon pull.DOCKER_BUILDKIT=0.Changes
BlobsUploadStart: when?digest=is present, upload the full body viaUploadCompleteBlob, create therepository_blobsentry, and return201 Created— matching OCI Distribution Spec single-post upload semantics.repository_blobsinsert: addON CONFLICT (repository_id, blob_id) DO NOTHINGso concurrent or retry uploads of the same blob don't fail the transaction.BlobsDownload: fix two missingreturnstatements after error handling that caused nil-pointer panics.UploadCompleteBlob: track byte count viacountReaderand expose asSizeon the response so the blob DB record gets the correct size.Test plan
docker buildwith default BuildKit (Docker 23+) and push to registry — pull should succeedDOCKER_BUILDKIT=0path still works