diff --git a/cli/command/image/tree.go b/cli/command/image/tree.go index d856f69f9e0c..db93bff0f98b 100644 --- a/cli/command/image/tree.go +++ b/cli/command/image/tree.go @@ -111,7 +111,7 @@ func runTree(ctx context.Context, dockerCLI command.Cli, opts treeOptions) (int, continue } - if len(sortedTags) == 0 { + if opts.all && len(sortedTags) == 0 { view.images = append(view.images, topImage{ Details: topDetails, Children: children,