skopeo
skopeo copied to clipboard
RFE: Add more kinds of annotations to (skopeo inspect) output
$ skopeo inspect docker://quay.io/fgiloux/fedora-httpd:latest --raw
{"schemaVersion":2,"config":{"mediaType":"application/vnd.oci.image.config.v1+json","digest":"sha256:a15eaef04d58fcca02f879d7c58d72a822b82cd42d427c1740542d49874ee912","size":1565},"layers":[{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","digest":"sha256:9c6cc34637169910926efbf525620fc39873beb0b2b3ba9fdf30d8662a38e407","size":59023256},{"mediaType":"application/vnd.oci.image.layer.v1.tar+gzip","digest":"sha256:6609bfb7c2ef3f42eedea7dab9a69309682b5e65e7601a74f9b00e695ee4bc52","size":26244427}],"annotations":{"org.opencontainers.image.base.digest":"sha256:63fa666e22333d85eaa6684fba51efe4b48dc5f5ff7b194cdc1fa1f1290b5c32","org.opencontainers.image.base.name":"registry.fedoraproject.org/fedora:latest"}}
Mind that annotations are returned.
$ skopeo inspect docker://quay.io/fgiloux/fedora-httpd:latest
{
"Name": "quay.io/fgiloux/fedora-httpd",
"Digest": "sha256:df05400702456755d883d895b8621253c2f4162f2edc5181dd4ca5d06781ba91",
"RepoTags": [
"latest"
],
"Created": "2022-03-04T07:13:47.818472465Z",
"DockerVersion": "",
"Labels": {
"io.buildah.version": "1.23.1",
"license": "MIT",
"name": "fedora",
"vendor": "Fedora Project",
"version": "35"
},
"Architecture": "amd64",
"Os": "linux",
"Layers": [
"sha256:9c6cc34637169910926efbf525620fc39873beb0b2b3ba9fdf30d8662a38e407",
"sha256:6609bfb7c2ef3f42eedea7dab9a69309682b5e65e7601a74f9b00e695ee4bc52"
],
"Env": [
"DISTTAG=f35container",
"FGC=f35",
"container=oci",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
]
}
Annotations are missing. It seems that there are not part of the output: https://github.com/containers/skopeo/blob/main/cmd/skopeo/inspect/output.go
I think it would be useful. I was interested in getting the base image. For my use case I am fine with using --raw but I was a bit puzzled not to see the information when I did not specify the option and thought that I may not be alone.
Thanks for reaching out, @fgiloux!
The request sounds reasonable to me. @mtrmac WDYT?
Sure, in principle.
The details get a bit messy, because OCI allows annotations on so many things. I suspect we would want IndexAnnotations
and IndividualManifestAnnotations
(naming??) and perhaps even ConfigBlobAnnotations
and something for every layer (along with reporting the layer’s size, which is another RFE somewhere around).
WRT an implementation approach, adding extra fields to the struct returned by c/image/types.Image.Inspect
is possible without breaking the API, so that’s easily possible.
A friendly reminder that this issue had no activity for 30 days.
hello is there any fix plan? thanks
A friendly reminder that this issue had no activity for 30 days.
https://github.com/containers/image/pull/1626 makes layer annotations available for skopeo inspect
to expose.
A friendly reminder that this issue had no activity for 30 days.
… and #1738 includes layer annotations in the skopeo inspect
output.
The index/manifest/config annotations are not yet exposed.
A friendly reminder that this issue had no activity for 30 days.
not stale
A friendly reminder that this issue had no activity for 30 days.
not stale
If this is something you want then I would recommend that you open a PR to introduce the concept.
A friendly reminder that this issue had no activity for 30 days.