Skip to content

Skopeo inspect: provide --top-level about included architectures #1283

@pombredanne

Description

@pombredanne

I would expect that inspect could return data from images even though they do not match my current OS/arch and without me first knowing about the image OS/Arch.
To me the whole purpose of inspect is that It should not require to know anything about the image OS or arch in the first place.

I have integrated skopeo here to fetch images https://github.com/nexB/scancode.io/blob/62911d1fe692327a23af85fa9668344deb5b9ebd/scanpipe/pipes/fetch.py#L132 but I cannot get inspect to get me data on arbitrary docker:// references unless I use inspect --raw first to find out about the architecture and OS.

Using the latest 1.2.3 version from Linux, I cannot get inspect to work when running this:

$ skopeo inspect docker://mcr.microsoft.com/windows:20H2
FATA[0000] Error parsing manifest for image: Error choosing image instance: 
no image found in manifest list for architecture amd64, variant "", OS linux

Yet things work with --override-os=windows:

$ skopeo inspect  --override-os=windows docker://mcr.microsoft.com/windows:20H2 
{
    "Name": "mcr.microsoft.com/windows",
    "Digest": "sha256:c52e2549de5fbd32a83b6f4f43e471b79a111432ec3fcd2f605f2a1c0653bd29",
    "RepoTags": [
        "10.0.17763.1039",
        "10.0.17763.1039-amd64",
        "10.0.17763.1040",
        "10.0.17763.1040-amd64",
        "10.0.17763.1098",
        "10.0.17763.1098-amd64",
        "10.0.17763.1158",

and this:

$ skopeo inspect  --raw docker://mcr.microsoft.com/windows:20H2 
{
   "schemaVersion": 2,
   "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
   "manifests": [
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 865,
         "digest": "sha256:01eaaa20c1ea39b30c5cbf0e24a528d02d7a23d0de316b0fc462cb6af029297f",
         "platform": {
            "architecture": "amd64",
            "os": "windows",
            "os.version": "10.0.19042.985"
         }
      }
   ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureA request for, or a PR adding, new functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions