diff --git a/cli/command/image/tree.go b/cli/command/image/tree.go index 4d032922a..040ce9499 100644 --- a/cli/command/image/tree.go +++ b/cli/command/image/tree.go @@ -111,6 +111,13 @@ func runTree(ctx context.Context, dockerCLI command.Cli, opts treeOptions) (int, continue } + if len(sortedTags) == 0 { + view.images = append(view.images, topImage{ + Details: topDetails, + Children: children, + created: img.Created, + }) + } for _, tag := range sortedTags { view.images = append(view.images, topImage{ Names: []string{tag},