Skip to content

c8d/image/inspect: Return Descriptor#48894

Merged
thaJeztah merged 1 commit intomoby:masterfrom
vvoland:c8d-image-inspect-manifest
Nov 18, 2024
Merged

c8d/image/inspect: Return Descriptor#48894
thaJeztah merged 1 commit intomoby:masterfrom
vvoland:c8d-image-inspect-manifest

Conversation

@vvoland
Copy link
Contributor

@vvoland vvoland commented Nov 18, 2024

Add the image target descriptor to the image inspect response.

- How to verify it

$ docker pull alpine
$ curl -s --unix-socket /var/run/docker.sock localhost/images/alpine/json | jq
{
  "Id": "sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a",
  "RepoTags": [
    "alpine:latest"
  ],
  "RepoDigests": [
    "alpine@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a"
  ],
  "Parent": "",
  "Comment": "buildkit.dockerfile.v0",
  "Created": "2024-09-06T12:05:36Z",
...
  "Descriptor": {
    "mediaType": "application/vnd.oci.image.index.v1+json",
    "digest": "sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a",
    "size": 9218
  }
}
$ docker pull arm64v8/alpine:3.10

$ curl -s --unix-socket /var/run/docker.sock localhost/images/arm64v8/alpine:3.10/json | jq

{
  "Id": "sha256:f73072b1ae04902f4d7511b834a1ea2d0475ddf6f87bd81f06e2b4590974a2e5",
  "RepoTags": [
    "arm64v8/alpine:3.10"
  ],
  "RepoDigests": [
    "arm64v8/alpine@sha256:f73072b1ae04902f4d7511b834a1ea2d0475ddf6f87bd81f06e2b4590974a2e5"
  ],
  "Parent": "",
  "Comment": "",
  "Created": "2021-04-14T18:43:17.827903143Z",
...
  "Descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
    "digest": "sha256:f73072b1ae04902f4d7511b834a1ea2d0475ddf6f87bd81f06e2b4590974a2e5",
    "size": 528
  }

- Description for the changelog

# Merge with the `GET /images/json`
containerd image store: `GET /images/json` and `GET /images/{name}/json` response now includes `Descriptor` field, which contains an OCI descriptor of the image target. The new field will only be populated if the daemon provides a multi-platform image store.

- A picture of a cute animal (not mandatory but encouraged)
Untitled

@vvoland vvoland added area/api API impact/api impact/changelog area/images Image Distribution containerd-integration Issues and PRs related to containerd integration labels Nov 18, 2024
@vvoland vvoland added this to the 28.0.0 milestone Nov 18, 2024
@vvoland vvoland self-assigned this Nov 18, 2024
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

should we have an integration test for this?

@vvoland vvoland force-pushed the c8d-image-inspect-manifest branch 2 times, most recently from dbb3cae to 89f7a5b Compare November 18, 2024 12:00
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland force-pushed the c8d-image-inspect-manifest branch from 89f7a5b to d88ab0f Compare November 18, 2024 12:00
@vvoland
Copy link
Contributor Author

vvoland commented Nov 18, 2024

Added a simple integration test

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@laurazard laurazard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit 21cb064 into moby:master Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API area/images Image Distribution containerd-integration Issues and PRs related to containerd integration impact/api impact/changelog

Projects

Development

Successfully merging this pull request may close these issues.

3 participants