docker / docker/buildx

imagetools: inspect only displays descriptor annotations

Open
#2,153 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement status/accepted
Dominant language
Go
Stars
4.5k
Forks
682
Avg merge
2d 14h
Merged PRs (30d)
29

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the docker buildx imagetools inspect commands and annotation configuration shown above. Trace the imagetools inspect entry point and its existing output tests, then ensure the default output includes index- and manifest-level annotations, while preserving the current --raw behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.