Skip to content

Commit e9d5a80

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 <pawel.gronowski@docker.com>
1 parent 941bfeb commit e9d5a80

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
@@ -113,7 +113,9 @@ func runImages(ctx context.Context, dockerCLI command.Cli, options imagesOptions
113113
}
114114
images := res.Items
115115
if !options.all {
116-
images = slices.DeleteFunc(images, isDangling)
116+
if _, ok := filters["dangling"]; ok {
117+
images = slices.DeleteFunc(images, isDangling)
118+
}
117119
}
118120

119121
if options.tree {

0 commit comments

Comments
 (0)