Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for container index to inspect endpoint #690

Open
pditommaso opened this issue Oct 15, 2024 · 0 comments
Open

Add support for container index to inspect endpoint #690

pditommaso opened this issue Oct 15, 2024 · 0 comments

Comments

@pditommaso
Copy link
Collaborator

Summary

The goal of this issue is to extend the inspect endpoint so that when it's specified a container reference identified a manifest index, the index content is returned instead of the container using a default platform.

Description

Lets consider the following container image reference docker.io/library/busybox:1.36.1-musl. This identify a multi-platform container having the following index manifest

{
  "manifests" : [ {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "amd64",
      "org.opencontainers.image.base.name" : "scratch",
      "org.opencontainers.image.created" : "2024-09-11T15:32:52Z",
      "org.opencontainers.image.revision" : "5eb4e443534e093c4d8fe2b6761432430827cc95",
      "org.opencontainers.image.source" : "https://github.com/docker-library/busybox.git",
      "org.opencontainers.image.url" : "https://hub.docker.com/_/busybox",
      "org.opencontainers.image.version" : "1.36.1-musl"
    },
    "digest" : "sha256:9a53a254f289b4e9542024676c004f8d4810f785641f8bbbecce03dda576e037",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "amd64",
      "os" : "linux"
    },
    "size" : 608
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "amd64",
      "vnd.docker.reference.digest" : "sha256:9a53a254f289b4e9542024676c004f8d4810f785641f8bbbecce03dda576e037",
      "vnd.docker.reference.type" : "attestation-manifest"
    },
    "digest" : "sha256:0361177897a7ac91b4ce83791d354ee0f34273b7ca1fcf06324d880591d26805",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "unknown",
      "os" : "unknown"
    },
    "size" : 559
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "arm32v6",
      "org.opencontainers.image.base.name" : "scratch",
      "org.opencontainers.image.created" : "2024-09-11T15:32:52Z",
      "org.opencontainers.image.revision" : "f952f50fdb990288c88868e2dd4466bfee28bbfc",
      "org.opencontainers.image.source" : "https://github.com/docker-library/busybox.git",
      "org.opencontainers.image.url" : "https://hub.docker.com/_/busybox",
      "org.opencontainers.image.version" : "1.36.1-musl"
    },
    "digest" : "sha256:17934c55824eff3072923db6cd7c3ba00359e57b730e5581e7273c610738f910",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "arm",
      "os" : "linux",
      "variant" : "v6"
    },
    "size" : 608
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "arm32v7",
      "org.opencontainers.image.base.name" : "scratch",
      "org.opencontainers.image.created" : "2024-09-11T15:32:52Z",
      "org.opencontainers.image.revision" : "9789898767be841976f1e28e0f89212db2de833d",
      "org.opencontainers.image.source" : "https://github.com/docker-library/busybox.git",
      "org.opencontainers.image.url" : "https://hub.docker.com/_/busybox",
      "org.opencontainers.image.version" : "1.36.1-musl"
    },
    "digest" : "sha256:c0d515df4d44c2a984c0aa8553e06b030a52c3800a6621e3ee393f3f42f8e995",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "arm",
      "os" : "linux",
      "variant" : "v7"
    },
    "size" : 608
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "arm32v7",
      "vnd.docker.reference.digest" : "sha256:c0d515df4d44c2a984c0aa8553e06b030a52c3800a6621e3ee393f3f42f8e995",
      "vnd.docker.reference.type" : "attestation-manifest"
    },
    "digest" : "sha256:9a68437b860b73305b2e024ef5b59549de4854ca797f1ed5999fa8e0cc30d203",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "unknown",
      "os" : "unknown"
    },
    "size" : 559
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "arm64v8",
      "org.opencontainers.image.base.name" : "scratch",
      "org.opencontainers.image.created" : "2024-09-11T15:32:52Z",
      "org.opencontainers.image.revision" : "9df05e09b53bcc7629ec0fc93242780ad29073b8",
      "org.opencontainers.image.source" : "https://github.com/docker-library/busybox.git",
      "org.opencontainers.image.url" : "https://hub.docker.com/_/busybox",
      "org.opencontainers.image.version" : "1.36.1-musl"
    },
    "digest" : "sha256:c6cdebd45a7b8fb6849484c6e079ed0db781d65bed367ae5804919ad3a4eda67",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "arm64",
      "os" : "linux",
      "variant" : "v8"
    },
    "size" : 608
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "arm64v8",
      "vnd.docker.reference.digest" : "sha256:c6cdebd45a7b8fb6849484c6e079ed0db781d65bed367ae5804919ad3a4eda67",
      "vnd.docker.reference.type" : "attestation-manifest"
    },
    "digest" : "sha256:9d84b10e7a10cd4d54b3b6c8c94d1da57f7d14e4f7072d9f956c66ada1dbbdcc",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "unknown",
      "os" : "unknown"
    },
    "size" : 559
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "i386",
      "org.opencontainers.image.base.name" : "scratch",
      "org.opencontainers.image.created" : "2024-09-11T15:32:52Z",
      "org.opencontainers.image.revision" : "cef2f29824bb353e1d13da2b52657f7645afb1ff",
      "org.opencontainers.image.source" : "https://github.com/docker-library/busybox.git",
      "org.opencontainers.image.url" : "https://hub.docker.com/_/busybox",
      "org.opencontainers.image.version" : "1.36.1-musl"
    },
    "digest" : "sha256:75d42d953cfefc2d76e9fad9552842624ced51571d8a549575a7d0bf92b6b030",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "386",
      "os" : "linux"
    },
    "size" : 608
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "i386",
      "vnd.docker.reference.digest" : "sha256:75d42d953cfefc2d76e9fad9552842624ced51571d8a549575a7d0bf92b6b030",
      "vnd.docker.reference.type" : "attestation-manifest"
    },
    "digest" : "sha256:10191af490b0793ec16e9f37b5eaade84c4523d9fcc622453462defff1f64eac",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "unknown",
      "os" : "unknown"
    },
    "size" : 559
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "ppc64le",
      "org.opencontainers.image.base.name" : "scratch",
      "org.opencontainers.image.created" : "2024-09-11T15:32:52Z",
      "org.opencontainers.image.revision" : "083d1a17d8cc851d6d29d798ca4b1f3ee4b6b564",
      "org.opencontainers.image.source" : "https://github.com/docker-library/busybox.git",
      "org.opencontainers.image.url" : "https://hub.docker.com/_/busybox",
      "org.opencontainers.image.version" : "1.36.1-musl"
    },
    "digest" : "sha256:1ebc4a9fb266aad32bfc753d9d5c87b6e1f1a6eb7a976784b4af28930af9a167",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "ppc64le",
      "os" : "linux"
    },
    "size" : 608
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "ppc64le",
      "vnd.docker.reference.digest" : "sha256:1ebc4a9fb266aad32bfc753d9d5c87b6e1f1a6eb7a976784b4af28930af9a167",
      "vnd.docker.reference.type" : "attestation-manifest"
    },
    "digest" : "sha256:45f85288f5b67beffb4fb8ccafdf0b841f1f5b76f103841c5f23ba67385ee15b",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "unknown",
      "os" : "unknown"
    },
    "size" : 559
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "riscv64",
      "org.opencontainers.image.base.name" : "scratch",
      "org.opencontainers.image.created" : "2024-09-11T15:32:52Z",
      "org.opencontainers.image.revision" : "32ea9383b7ff2b818d8a206ed264d5a721b5a290",
      "org.opencontainers.image.source" : "https://github.com/docker-library/busybox.git",
      "org.opencontainers.image.url" : "https://hub.docker.com/_/busybox",
      "org.opencontainers.image.version" : "1.36.1-musl"
    },
    "digest" : "sha256:2d91f6c14d238a12d20fa53250a1c5c9f5322c8457904103fb04184fad393077",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "riscv64",
      "os" : "linux"
    },
    "size" : 608
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "riscv64",
      "vnd.docker.reference.digest" : "sha256:2d91f6c14d238a12d20fa53250a1c5c9f5322c8457904103fb04184fad393077",
      "vnd.docker.reference.type" : "attestation-manifest"
    },
    "digest" : "sha256:c7f2cc09e7b0bde204cb01cb04f1da1745a42c2995f76459fbe65d0f200566df",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "unknown",
      "os" : "unknown"
    },
    "size" : 559
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "s390x",
      "org.opencontainers.image.base.name" : "scratch",
      "org.opencontainers.image.created" : "2024-09-11T15:32:52Z",
      "org.opencontainers.image.revision" : "6789229a68e5c3879f0eab31059f08466884e147",
      "org.opencontainers.image.source" : "https://github.com/docker-library/busybox.git",
      "org.opencontainers.image.url" : "https://hub.docker.com/_/busybox",
      "org.opencontainers.image.version" : "1.36.1-musl"
    },
    "digest" : "sha256:88a9b9e39c4f9b715a14b5cebe89bcbe16af930490b8aeb5632a003300568a09",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "s390x",
      "os" : "linux"
    },
    "size" : 608
  }, {
    "annotations" : {
      "com.docker.official-images.bashbrew.arch" : "s390x",
      "vnd.docker.reference.digest" : "sha256:88a9b9e39c4f9b715a14b5cebe89bcbe16af930490b8aeb5632a003300568a09",
      "vnd.docker.reference.type" : "attestation-manifest"
    },
    "digest" : "sha256:bb77b53bfddda83eae274a1d304711c3cb820043ce5e67132ef77953f810d601",
    "mediaType" : "application/vnd.oci.image.manifest.v1+json",
    "platform" : {
      "architecture" : "unknown",
      "os" : "unknown"
    },
    "size" : 559
  } ],
  "mediaType" : "application/vnd.oci.image.index.v1+json",
  "schemaVersion" : 2
}

The access to a specific container requires providing a specific platform (ie. arch) e.g. linux/amd64.

The goal of this issues is to extend the inspect endpoint so that it returns the content of the index is the a specific platform is not specified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant