Skip to content
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

docker-archive support OCI manifest media type #2665

Closed

Conversation

davidwtf
Copy link

No description provided.

Signed-off-by: tfwang <tfwang@alauda.io>
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

This doesn’t work that way.

Locally, without updating SupportedManifestMIMETypes the generic copy code would convert and not send an OCI manifest, so this PR does not affect typical uses like skopeo copy at all.

More importantly, AFAIK this doesn’t really make a difference, the file format as implemented by Docker (who is, by definition, authoritative) is not flexible to the supported manifests. In fact, the “traditional” docker save format does not have a manifest in this sense at all! It uses a docker-archive-specific top-level manifest format.

Nowadays, IIRC, Docker does support using the OCI format in docker save/docker load, but it does not use the “traditional” format for that purpose; uses the full opencontainers/image-spec archive layout (and, on docker save, creates a file which can be read in both the “traditional” and OCI formats).

Implementing these dual-format archives would be, potentially, interesting, but also much more work than this — e.g. the generic design of containers/image/copy really assumes that every copy uses a single format.

And, contemplating the possibility of a future support of these dual-format archives, we actively don’t want to use the “traditional” format to store OCI, or OCI-like, images, because that would preclude using the new dual-format archive format for OCI images in the future.

@davidwtf
Copy link
Author

Yes, you are right.

I directly called the containers/image interface in my program without using skopeo.
But I encountered an error: Unsupported manifest type, need a Docker schema 2 manifest, which led me to mistakenly believe that containers/image does not support converting OCI format images to docker-archive format, hence I submitted this PR.

However, after reading your comment, I verified it with skopeo and studied the differences between my program and skopeo's use of containers/image in detail. Then I discovered that when calling copy.Image, I passed PreserveDigests: true, which caused it not to perform manifests conversion. My mistake.

Thank you for your reply. I will close this PR.

@davidwtf davidwtf closed this Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants