skopeo icon indicating copy to clipboard operation
skopeo copied to clipboard

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

Open fgiloux opened this issue 2 years ago • 14 comments

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

fgiloux avatar Mar 04 '22 08:03 fgiloux

Thanks for reaching out, @fgiloux!

The request sounds reasonable to me. @mtrmac WDYT?

vrothberg avatar Mar 04 '22 08:03 vrothberg

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.

mtrmac avatar Mar 04 '22 16:03 mtrmac

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

github-actions[bot] avatar Apr 04 '22 00:04 github-actions[bot]

hello is there any fix plan? thanks

tanguofu avatar Apr 11 '22 07:04 tanguofu

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

github-actions[bot] avatar May 12 '22 00:05 github-actions[bot]

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

mtrmac avatar Aug 08 '22 13:08 mtrmac

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

github-actions[bot] avatar Sep 08 '22 00:09 github-actions[bot]

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

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

mtrmac avatar Dec 05 '22 21:12 mtrmac

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

github-actions[bot] avatar Dec 14 '23 00:12 github-actions[bot]

not stale

rittneje avatar Dec 14 '23 00:12 rittneje

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

github-actions[bot] avatar Jan 14 '24 00:01 github-actions[bot]

not stale

rittneje avatar Jan 14 '24 00:01 rittneje

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

rhatdan avatar Jan 17 '24 20:01 rhatdan

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

github-actions[bot] avatar Feb 17 '24 00:02 github-actions[bot]