camallo / dkregistry-rs

A pure-Rust asynchronous library for Docker Registry API v2
Apache License 2.0
62 stars 39 forks source link

No convenient way for accessing image labels for all manifest formats #57

Open steveej opened 5 years ago

steveej commented 5 years ago

Image labels can be created within the Dockerfile with the LABEL instruction.

Although not officially documented, we could get these via the already implemented manifests:

On quay.io there's an API endpoint for getting labels, which requires a manifestref that must be fetched via the listRepoTags endpoint first.


Implementation state

wking commented 5 years ago

Although not officially documented...

For forward-looking images, it's probably best to look at the OCI docs. For labels/annotations, the relevant spec sections are here, here, here, and here (although the spec doesn't have much to say about how to assemble annotations from those sources (see this comment).

steveej commented 5 years ago

Thanks for those pointers. I got the above information from a the Quay team directly, which is currently the source of truth. Of course this might change in the future but for now this is what we're working with.

Since Quay currently emits V2 S1 manifests I started implementing the V2 S1 label parser. It's pretty straight forward as the v1compat struct history array is already part of what we have. See how the Label is stuff into that from this fixture example.