diff --git a/cli/command/formatter/disk_usage.go b/cli/command/formatter/disk_usage.go index 6f97d3b0f9..5309d880a5 100644 --- a/cli/command/formatter/disk_usage.go +++ b/cli/command/formatter/disk_usage.go @@ -192,7 +192,10 @@ func (c *diskUsageImagesContext) Reclaimable() string { c.AddHeader(reclaimableHeader) for _, i := range c.images { if i.Containers != 0 { - used += i.Size + if i.VirtualSize == -1 || i.SharedSize == -1 { + continue + } + used += i.VirtualSize - i.SharedSize } } diff --git a/daemon/images.go b/daemon/images.go index 01dbced164..88fb8f8e91 100644 --- a/daemon/images.go +++ b/daemon/images.go @@ -205,7 +205,7 @@ func (daemon *Daemon) Images(imageFilters filters.Args, all bool, withExtraAttrs } if withExtraAttrs { - // Get Shared and Unique sizes + // Get Shared sizes for img, newImage := range imagesMap { rootFS := *img.RootFS rootFS.DiffIDs = nil