Skip to content

Show digests for untagged images when requested by the image list format - #7556

Open
Kazumi565 wants to merge 1 commit into
docker:masterfrom
Kazumi565:fix/digest-only-image-format
Open

Kazumi565 wants to merge 1 commit into
docker:masterfrom
Kazumi565:fix/digest-only-image-format

Conversation

@Kazumi565

Copy link
Copy Markdown

For an image pulled by digest with no local tag, docker image ls -a --format '{{.Digest}}' prints an empty line. Adding --digests to the same command prints the digest. Tagged images already honor the format without the extra flag.

Use the same format check for digest-only references that the formatter uses for tagged references. The regression test lists an image with two digest references and verifies that {{.Digest}} prints both, one per line.

Verified against Docker CLI 29.9.3 and a local daemon. The image command and formatter package tests pass on Linux.

Related to #6960. That PR addresses whether digest-only images appear in the list. This change fixes the digest displayed for a row that is already present with --all.

Signed-off-by: Mihai Bargan <97226295+Kazumi565@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

1 participant