Skip to content

imagetools: inspect only displays descriptor annotations #2153

@dvdksn

Description

@dvdksn

Contributing guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

  • The pretty format of imagetools inspect IMAGE doesn't show annotations on the index-level, only descriptors. They are only shown if you use --raw
  • Annotations on the manifest-level (imagetools inspect IMAGE@DIGEST) are also not shown (only with --raw)

Expected behaviour

I expected to be able to see all annotations in the pretty/default output format as I can see with --raw

Actual behaviour

Only annotations on the index are shown

Buildx version

github.com/docker/buildx v0.12.0-desktop.2 c5a13b51c1ae9358eb691e9a21c955590e26d0a0

Docker info

No response

Builders list

n/a

Configuration

target "default" {
	tags = ["davidkarlsson416/build:annotations"]
	output = ["type=registry"]
	annotations = [
		"index:foo=bar",
		"manifest:baz=quux",
	]
}
$ docker buildx bake
$ docker buildx imagetools inspect --raw davidkarlsson416/build:annotations | jq '.annotations'
{
  "foo": "bar"
}
$ docker buildx imagetools inspect davidkarlsson416/build:annotations 
Name:      docker.io/davidkarlsson416/build:annotations
MediaType: application/vnd.oci.image.index.v1+json
Digest:    sha256:6e65bf3f63fda02126dcc3bad87a81f686d579f9f70c00b852cd36e537d0e4c4
           
Manifests: 
  Name:        docker.io/davidkarlsson416/build:annotations@sha256:d287b4eced51b94f6dd1ab8617629828273ac11e642d4de3fc00ecdf6b8e900b
  MediaType:   application/vnd.oci.image.manifest.v1+json
  Platform:    linux/arm64
               
  Name:        docker.io/davidkarlsson416/build:annotations@sha256:36777ce0220f8ab9ac9927ec14c71d3d39a8ed3fa7b23b02d827cdbc53b5fe89
  MediaType:   application/vnd.oci.image.manifest.v1+json
  Platform:    unknown/unknown
  Annotations: 
    vnd.docker.reference.digest: sha256:d287b4eced51b94f6dd1ab8617629828273ac11e642d4de3fc00ecdf6b8e900b
    vnd.docker.reference.type:   attestation-manifest
$ docker buildx imagetools inspect --raw docker.io/davidkarlsson416/build:annotations@sha256:d287b4eced51b94f6dd1ab8617629828273ac11e642d4de3fc00ecdf6b8e900b | jq '.annotations'
{
  "baz": "quux"
}
$ docker buildx imagetools inspect docker.io/davidkarlsson416/build:annotations@sha256:d287b4eced51b94f6dd1ab8617629828273ac11e642d4de3fc00ecdf6b8e900b      
Name:      docker.io/davidkarlsson416/build:annotations@sha256:d287b4eced51b94f6dd1ab8617629828273ac11e642d4de3fc00ecdf6b8e900b
MediaType: application/vnd.oci.image.manifest.v1+json
Digest:    sha256:d287b4eced51b94f6dd1ab8617629828273ac11e642d4de3fc00ecdf6b8e900b

Build logs

No response

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions