From 64805c29595d24181143211434e0b7af2aef6378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Fri, 24 Oct 2025 20:24:45 +0200 Subject: [PATCH] image/list: Respect `dangling` filter when not using `--all` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise `docker images --filter dangling=true` won't work without `--all`. Signed-off-by: Paweł Gronowski --- cli/command/image/list.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/command/image/list.go b/cli/command/image/list.go index d4a5a46cb7..d267c4778b 100644 --- a/cli/command/image/list.go +++ b/cli/command/image/list.go @@ -116,7 +116,9 @@ func runImages(ctx context.Context, dockerCLI command.Cli, options imagesOptions } images := res.Items if !options.all { - images = slices.DeleteFunc(images, isDangling) + if _, ok := filters["dangling"]; ok { + images = slices.DeleteFunc(images, isDangling) + } } if options.tree {