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

Add docker media types in OCI formats #2695

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

brbayes-msft
Copy link
Contributor

This pull request adds the docker media types when reading back OCI formats, along with the corresponding tests. This is from running into cases where docker images were built with the docker media types. To avoid having to convert all of the existing manifests so that the original types can be maintained, this code adds support for reading the docker specific formats since the OCI formats are backwards compatible with the docker formats (https://github.com/opencontainers/image-spec/blob/main/media-types.md).

@brbayes-msft brbayes-msft marked this pull request as ready for review January 23, 2025 18:36
@mtrmac
Copy link
Collaborator

mtrmac commented Jan 27, 2025

Thanks. At a high level, I’m really unsure.

For reading images, sure, that’s ~easy enough. But are the users then going to ask to also supporting writes with non-OCI images? Does the DeleteImage code need to be able to handle non-OCI media types?

Approximately, I generally think that any producer creating an OCI-layout directory structure is obviously aware of OCI, so I don’t know why any new user of this code should start to want to support pre-OCI images.

What’s the use case?

If the goal were to write some kind of general-purpose image storage mechanism, note that the OCI transport (currently) can’t do that, e.g. it doesn’t support reading/writing signatures along with the image.

@brbayes-msft
Copy link
Contributor Author

The main issue I'm looking to address here is cases where tooling such as the Docker Daemon pull existing images from upstreams, and those upstream images still use docker media types. With the recent switch for the Docker Daemon to save dual format archives (both oci and docker archive), we run into an issue where the archive is still an OCI layout, but it maintained its original media types, thus breaking tools like Skopeo.

I do agree that when creating OCI layouts, the creator is likely aware of the OCI types and should conform to them when possible. That's why I focused primarily on only read operations so as to better handle the case where tooling changes the wrapper. That being said, if there are other areas of the code that I should fill out, I'm happy to do so.

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