From 1a950db5cebf7846b0ca878564820e3f19036620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Fri, 11 Apr 2025 13:28:33 +0200 Subject: [PATCH] cli/command/image: Fix total content size calculation in image tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this patch, image total content size would only include container images content size. Signed-off-by: Paweł Gronowski --- cli/command/image/tree.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/command/image/tree.go b/cli/command/image/tree.go index a095173bd7..804b80679e 100644 --- a/cli/command/image/tree.go +++ b/cli/command/image/tree.go @@ -54,6 +54,8 @@ func runTree(ctx context.Context, dockerCLI command.Cli, opts treeOptions) error var totalContent int64 children := make([]subImage, 0, len(img.Manifests)) for _, im := range img.Manifests { + totalContent += im.Size.Content + if im.Kind == imagetypes.ManifestKindAttestation { attested[im.AttestationData.For] = true continue @@ -78,7 +80,6 @@ func runTree(ctx context.Context, dockerCLI command.Cli, opts treeOptions) error details.InUse = true } - totalContent += im.Size.Content children = append(children, sub) // Add extra spacing between images if there's at least one entry with children.