oras-project / rust-oci-client

A Rust crate to interact with OCI registries
Apache License 2.0
90 stars 47 forks source link

Support OCI Image Configuration #50

Open Xynnn007 opened 1 year ago

Xynnn007 commented 1 year ago

Now the Config is only a poor Vec<u8> named data. It is needed to support OCI Image Configuration due to https://github.com/opencontainers/image-spec/blob/v1.0/config.md, as v1.1 is still in rc stage and not stable.

thomastaylor312 commented 1 year ago

Hey there @Xynnn007! Could you clarify a bit what you'd like to add here? As you mentioned, we have to do this because of the spec, were you suggesting we add something more structured? If so, what would you like it to look like?

Xynnn007 commented 1 year ago

Hey @thomastaylor312 , nice to get your feedback. As you've mentioned, I suggest adding something more structured as the spec defines https://github.com/opencontainers/image-spec/blob/v1.0/config.md.

I'm not an expert in this, but when I'm trying to test using a local registry, a pushed image in the registry contains a more structured Config. A random structure of Config might let a (commercial) registry to clear the image.

Xynnn007 commented 1 year ago

I pushed a PR including definitions of the structures, but still, we need related functions?

lswith commented 1 year ago

I've added 2 PRs related to this:

I'm hoping that we can capture an "oci config" in the ConfigFile type, and convert from the client::Config to the config::ConfigFile and back. This will make it easier to parse images that have been pulled from a registry as well as generate new configs when pushing.