Skip to content

Commit c718d3f

Browse files
authored
Merge pull request #6000 from vvoland/image-tree-totalcontent
cli/command/image: Fix total content size calculation in image tree
2 parents e286562 + 1a950db commit c718d3f

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)