-
Notifications
You must be signed in to change notification settings - Fork 798
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
oci scheme changes the mediaTypes #1692
Comments
@developer-guy is the assumption that converting between OCI and Docker format preserves the digest? The digests will change since the media types are different. A Docker manifest does not comply with the OCI image spec, so it must be changed during conversion. |
Yes, the OCI image spec (which the If you don’t care about OCI compliance and interoperability, use something else; either the c/image-private |
I think there's enough wiggle room in the spec that you could read this either way. I don't see anything that forbids an OCI image layout from containing a docker image (e.g. see this example which has a non-OCI entry in |
I agree it’s possible to store images that way. I do think that the default behavior needs to be to convert, so that they can be read back by another implementation with high confidence. It might make sense to store unconverted images with an opt-in. The current implementation of c/image transports has the concept of “supported” manifest formats, where an image in a format supported by a destination is stored there without a format conversion (while Looking a bit more at use cases, the extra valuable feature of OCI unavailable in [1] Surprisingly, v2s1 happens to be the only format that works, from time to time, typically if due to c/image implementation bugs, or strict registry validation, OCI and v2s2 is rejected. It’s not always 100% clear whether converting and things transparently mostly-working, or cleanly failing, is the better behavior. |
@vrothberg Since skopeo mutate all
One workaround is to traverse all JSONs and replace all media types to What's the best and right way to copy the image by respecting the digest? |
That’s not going to work in general; the digest detects format modification of any kind, including change in whitespace. There is no relationship between the whitespace of the input manifest and of the manifest produced by Skopeo when converting, so modifying Skopeo’s output that way is not typically going to reproduce the original manifest. What's the best and right way to copy the image by respecting the digest? upstream -> local -> upstream
Sure, the latter recommendation is a bit of a hassle … the thing is, a production-level registry implements most of the desirable features already. In both cases you should probably use |
We (w/@Dentrax) noticed that while copying a Docker-typed image to a directory by using the
oci
scheme, the mediaTypes of the image are changed fromvnd.docker..
tovnd.oci..
, and it's leading to a change the digest of an image. But in thecrane
tool, mediaTypes remains the same for the same operation. So we wanted to open an issue to discuss which type of operation is correct or makes sense.To reproduce the issue, we can consider using
alpine:3.16
image:@mtrmac @imjasonh @jonjohnsonjr
The text was updated successfully, but these errors were encountered: