Skip to content

Commit 1a950db

Browse files
committed
cli/command/image: Fix total content size calculation in image tree
Before this patch, image total content size would only include container images content size. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
1 parent e286562 commit 1a950db

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cli/command/image/tree.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ func runTree(ctx context.Context, dockerCLI command.Cli, opts treeOptions) error
5454
var totalContent int64
5555
children := make([]subImage, 0, len(img.Manifests))
5656
for _, im := range img.Manifests {
57+
totalContent += im.Size.Content
58+
5759
if im.Kind == imagetypes.ManifestKindAttestation {
5860
attested[im.AttestationData.For] = true
5961
continue
@@ -78,7 +80,6 @@ func runTree(ctx context.Context, dockerCLI command.Cli, opts treeOptions) error
7880
details.InUse = true
7981
}
8082

81-
totalContent += im.Size.Content
8283
children = append(children, sub)
8384

8485
// Add extra spacing between images if there's at least one entry with children.

0 commit comments

Comments
 (0)