You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
imagetools inspect --format ignores formatting unless json is used #1175
This is inconsistent with other commands, for example, here's docker image inspect (difference between using json and without is that the json output uses JSON quoting for the output);
Also note that the json output does not print a newline at the end, which can make it a bit cumbersome to use; here's the full output (notice that the prompt is appended to the output, because there's no trailing newline)
Thanks! Yeah, I was mostly surprised it was silently ignored 😅. w.r.t. the newline at the end; technically it's "correct" (the newline doesn't have to be there (also not when using it for scripting), but ISTR the newline was added to make it slightly easier to use interactively.
Hey! It looks like this issue is coming up on a year old, is this fixable now given the aforementioned PR was merged? I still see this behaviour today.
The linked PR was implementing changes in the docker CLI itself; this probably hasn't been worked on for buildx. Contributions welcome though if someone is interested working on this.
Sure, I'm taking a look now. There's definitely something funky going on given it doesn't seem that Go templates for {{.Manifest are respected and includes duplicate logic.
Cool, I removed that logic and it seems to work as expected. I'll clean it up and submit a PR.
❯ go run ./cmd/buildx imagetools inspect --format="{{.Manifest.Digest}}" alpine
sha256:02bb6f428431fbc2809c5d1b41eab5a68350194fb508869a33cb1af4444c9b11
Fixed in v0.33.0 (#3721 and 78439e2): the {{.Manifest... prefix check that treated any template starting with .Manifest as "print the whole manifest" was replaced by an exact match for {{.Manifest}}, so templates like {{.Manifest.Digest}} are executed. --raw intentionally omits the trailing newline.
Activity
thaJeztah commentedon Jun 21, 2022
/cc @crazy-max @jedevc
crazy-max commentedon Jun 21, 2022
@thaJeztah Since docker/cli#2936 has been merged I will revisit the format output to be aligned.
thaJeztah commentedon Jun 21, 2022
Thanks! Yeah, I was mostly surprised it was silently ignored 😅. w.r.t. the newline at the end; technically it's "correct" (the newline doesn't have to be there (also not when using it for scripting), but ISTR the newline was added to make it slightly easier to use interactively.
uhthomas commentedon Jun 13, 2023
Hey! It looks like this issue is coming up on a year old, is this fixable now given the aforementioned PR was merged? I still see this behaviour today.
❯ docker buildx imagetools inspect debian:bullseye --format="{{.Manifest.Digest}}" Name: docker.io/library/debian:bullseye MediaType: application/vnd.docker.distribution.manifest.list.v2+json Digest: sha256:1e5f2d70c9441c971607727f56d0776fb9eecf23cd37b595b26db7a974b2301d Manifests: ...thaJeztah commentedon Jun 13, 2023
The linked PR was implementing changes in the docker CLI itself; this probably hasn't been worked on for buildx. Contributions welcome though if someone is interested working on this.
uhthomas commentedon Jun 14, 2023
Sure, I'm taking a look now. There's definitely something funky going on given it doesn't seem that Go templates for
{{.Manifestare respected and includes duplicate logic.uhthomas commentedon Jun 14, 2023
Cool, I removed that logic and it seems to work as expected. I'll clean it up and submit a PR.
❯ go run ./cmd/buildx imagetools inspect --format="{{.Manifest.Digest}}" alpine sha256:02bb6f428431fbc2809c5d1b41eab5a68350194fb508869a33cb1af4444c9b11imagetools: use docker/cli formatting
imagetools: use docker/cli formatting
imagetools: use docker/cli formatting
segevfiner commentedon Sep 17, 2025
Using
--format '{{printf "%s" .Manifest.Digest}}'also seems to work. Until this is fixed, that is.crazy-max commentedon Sep 3, 2026
Fixed in v0.33.0 (#3721 and 78439e2): the
{{.Manifest...prefix check that treated any template starting with.Manifestas "print the whole manifest" was replaced by an exact match for{{.Manifest}}, so templates like{{.Manifest.Digest}}are executed.--rawintentionally omits the trailing newline.fix(demo): resolve image digests with a buildx-version-independent te…
fix(demo): resolve image digests with a buildx-version-independent te…
fix: read the pushed registry digest through the JSON formatter
feat: manual immutable image release workflow + digest-only release b…