-
Notifications
You must be signed in to change notification settings - Fork 1.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
manifest digest mismatch pushing to private docker registry #2963
Comments
That's correct; there are some recommendations about using some canonicalization of the JSON, but (see the OCI distribution spec appendix and the Digest section in the OCI imager spect, the digest is calculated over the byte data, so effectively the JSON should be treated as an opaque blob (for purpose of calculating the digest). There is a mention about handling those digests, but it's a bit ambiguous as this section is described in the image spec, but referenced by the distribution spec;
However;
In this case, the error comes from validating the buildkit/vendor/github.com/containerd/containerd/remotes/docker/pusher.go Lines 418 to 425 in 874eef9
Handling I do agree that the section on "push" could be clearer; there is a mention of the
However, it leaves some things open to interpretation. AFAIK, given that registries provide a content-addressable store, the expectation should be that an uploaded artefact is stored verbatim, and after uploading can be accessed by its given digest, but the lack of documentation around that makes it indeed rather open to interpretation, and could be interpreted as either;
It may be worth opening a ticket in the OCI distribution spec issue tracker (or a pull request to propose changes). |
Your registry is not supposed to reencode the JSON uploaded by the client. The exact bytes should be stored and returned on the next GET. |
Thanks for the detailed explanation! I'll move the discussion over to the spec repo and close this out. |
I'm exploring integrating buildkit with some internal tooling at my company, which including pushing container images to a private registry we've written in-house.
Buildkit fails to push with errors like:
This is actually the last step of the pushing process so the error can be ignored, but it got me wondering whether our registry implementation is wrong, or if this is a bug in buildkit.
Looking at this oci spec:
I don't see any clear statement that the digest returned by the registry must match the one generated by the client. For the manifest in particular, there doesn't seem to be a canonical way to marshal it into JSON, which is why the digests differ between client and server in this case.
Am I missing something, or is the buildkit client too strict here?
The text was updated successfully, but these errors were encountered: