dkregistry-rs icon indicating copy to clipboard operation
dkregistry-rs copied to clipboard

No convenient way for accessing image labels for all manifest formats

Open steveej opened this issue 7 years ago • 2 comments

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:

  • V2 S1 they are stored in the first element of the history array, and
  • V2 S2 they are stored in the config array.

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

  • [x] V2S1 #59
  • [ ] V2S2
  • ~~Quay API~~ (calling out to this directly shouldn't go into this crate)

steveej avatar Nov 07 '18 12:11 steveej

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).

wking avatar Nov 07 '18 23:11 wking

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.

steveej avatar Nov 07 '18 23:11 steveej