Skip to content

Commit 64805c2

Browse files
committed
image/list: Respect dangling filter when not using --all
Otherwise `docker images --filter dangling=true` won't work without `--all`. Signed-off-by: Paweł Gronowski <[email protected]>
1 parent e9a9410 commit 64805c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cli/command/image/list.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ func runImages(ctx context.Context, dockerCLI command.Cli, options imagesOptions
116116
}
117117
images := res.Items
118118
if !options.all {
119-
images = slices.DeleteFunc(images, isDangling)
119+
if _, ok := filters["dangling"]; ok {
120+
images = slices.DeleteFunc(images, isDangling)
121+
}
120122
}
121123

122124
if options.tree {

0 commit comments

Comments
 (0)