containers / skopeo

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

Skopeo inspect vs Crane manifest #2149

Closed codequester closed 10 months ago

codequester commented 10 months ago

Hi, i am assuming that the inspect command reads the manifest of the OCI image but wondering why its different from the out put of crane manifest . Pls find the output from both the commands below

$ skopeo inspect docker://shankar29/hello-container | jq .
{
  "Name": "docker.io/shankar29/hello-container",
  "Digest": "sha256:35f78dd7de20703a3492390b4d35661d7833642809ad04c32a64416bb545de72",
  "RepoTags": [
    "latest",
    "sha256-35f78dd7de20703a3492390b4d35661d7833642809ad04c32a64416bb545de72.sig"
  ],
  "Created": "2023-10-26T17:41:08.692094784Z",
  "DockerVersion": "",
  "Labels": {
    "io.buildah.version": "1.29.0"
  },
  "Architecture": "amd64",
  "Os": "linux",
  "Layers": [
    "sha256:f56be85fc22e46face30e2c3de3f7fe7c15f8fd7c4e5add29d7f64b87abdaa09"
  ],
  "LayersData": [
    {
      "MIMEType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "Digest": "sha256:f56be85fc22e46face30e2c3de3f7fe7c15f8fd7c4e5add29d7f64b87abdaa09",
      "Size": 3374563,
      "Annotations": null
    }
  ],
  "Env": [
    "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
  ]
}

and

$ crane manifest docker.io/shankar29/hello-container | jq .
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "config": {
    "mediaType": "application/vnd.oci.image.config.v1+json",
    "digest": "sha256:4e598efae28d7604892124984f2be9df9de6e0f7065f1b72e65773ef2d181031",
    "size": 818
  },
  "layers": [
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:f56be85fc22e46face30e2c3de3f7fe7c15f8fd7c4e5add29d7f64b87abdaa09",
      "size": 3374563
    }
  ],
  "annotations": {
    "org.opencontainers.image.base.digest": "sha256:b6ca290b6b4cdcca5b3db3ffa338ee0285c11744b4a6abaa9627746ee3291d8d",
    "org.opencontainers.image.base.name": "docker.io/library/alpine:latest"
  }
}

Thanks Shankar

mtrmac commented 10 months ago

Thanks for reaching out


skopeo inspect docker://shankar29/hello-container | jq .

  "schemaVersion": 2,
mtrmac commented 10 months ago

Thanks for reaching out.

skopeo inspect docker://shankar29/hello-container | jq .

  "schemaVersion": 2,

skopeo inspect never produces that output with that (lack of) options. Please provide a complete, accurate, reproducer.


It seems the report was edited and the original report was closer to something accurate…

The output of skopeo inspect is, by default, not the raw OCI data. (One of the major reasons to use skopeo inspect is to abstract from the several possible raw formats). You might want the --raw option.

codequester commented 10 months ago

@mtrmac Sorry i mixed up the output of the 2 commands. Pls find the corrected version. I have edited my original post. I will try the --raw option as well

Thanks Shankar

codequester commented 10 months ago

Thanks --raw options produces the same output. Thanks for the quick response!!