containers / skopeo

Work with remote images registries - retrieving information, images, signing content
Apache License 2.0
8.14k stars 771 forks source link

RFE: Add more kinds of annotations to (skopeo inspect) output #1583

Open fgiloux opened 2 years ago

fgiloux commented 2 years ago
$ 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.

vrothberg commented 2 years ago

Thanks for reaching out, @fgiloux!

The request sounds reasonable to me. @mtrmac WDYT?

mtrmac commented 2 years ago

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.

github-actions[bot] commented 2 years ago

A friendly reminder that this issue had no activity for 30 days.

tanguofu commented 2 years ago

hello is there any fix plan? thanks

github-actions[bot] commented 2 years ago

A friendly reminder that this issue had no activity for 30 days.

mtrmac commented 2 years ago

https://github.com/containers/image/pull/1626 makes layer annotations available for skopeo inspect to expose.

github-actions[bot] commented 2 years ago

A friendly reminder that this issue had no activity for 30 days.

mtrmac commented 1 year ago

… and #1738 includes layer annotations in the skopeo inspect output.

The index/manifest/config annotations are not yet exposed.

github-actions[bot] commented 10 months ago

A friendly reminder that this issue had no activity for 30 days.

rittneje commented 10 months ago

not stale

github-actions[bot] commented 9 months ago

A friendly reminder that this issue had no activity for 30 days.

rittneje commented 9 months ago

not stale

rhatdan commented 8 months ago

If this is something you want then I would recommend that you open a PR to introduce the concept.

github-actions[bot] commented 7 months ago

A friendly reminder that this issue had no activity for 30 days.