@@ -205,7 +205,7 @@ func newImageContext() *imageContext {
205205 "CreatedAt" : CreatedAtHeader ,
206206 "Size" : SizeHeader ,
207207 "Containers" : containersHeader ,
208- "VirtualSize" : SizeHeader ,
208+ "VirtualSize" : SizeHeader , // Deprecated: VirtualSize is deprecated, and equivalent to Size.
209209 "SharedSize" : sharedSizeHeader ,
210210 "UniqueSize" : uniqueSizeHeader ,
211211 }
@@ -260,8 +260,13 @@ func (c *imageContext) Containers() string {
260260 return fmt .Sprintf ("%d" , c .i .Containers )
261261}
262262
263+ // VirtualSize shows the virtual size of the image and all of its parent
264+ // images. Starting with docker 1.10, images are self-contained, and
265+ // the VirtualSize is identical to Size.
266+ //
267+ // Deprecated: VirtualSize is deprecated, and equivalent to [imageContext.Size].
263268func (c * imageContext ) VirtualSize () string {
264- return units .HumanSize (float64 (c .i .VirtualSize ))
269+ return units .HumanSize (float64 (c .i .Size ))
265270}
266271
267272func (c * imageContext ) SharedSize () string {
@@ -272,8 +277,8 @@ func (c *imageContext) SharedSize() string {
272277}
273278
274279func (c * imageContext ) UniqueSize () string {
275- if c .i .VirtualSize == - 1 || c .i .SharedSize == - 1 {
280+ if c .i .Size == - 1 || c .i .SharedSize == - 1 {
276281 return "N/A"
277282 }
278- return units .HumanSize (float64 (c .i .VirtualSize - c .i .SharedSize ))
283+ return units .HumanSize (float64 (c .i .Size - c .i .SharedSize ))
279284}
0 commit comments