Skip to content

Commit 394ab41

Browse files
authored
Merge pull request #6524 from thaJeztah/rm_deprecated_virtualsize
remove VirtualSize formatting options and output
2 parents 9c79528 + 1b90a53 commit 394ab41

File tree

5 files changed

+64
-112
lines changed

5 files changed

+64
-112
lines changed

cli/command/formatter/image.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ func newImageContext() *imageContext {
202202
"CreatedAt": CreatedAtHeader,
203203
"Size": SizeHeader,
204204
"Containers": containersHeader,
205-
"VirtualSize": SizeHeader, // Deprecated: VirtualSize is deprecated, and equivalent to Size.
206205
"SharedSize": sharedSizeHeader,
207206
"UniqueSize": uniqueSizeHeader,
208207
}
@@ -257,15 +256,6 @@ func (c *imageContext) Containers() string {
257256
return strconv.FormatInt(c.i.Containers, 10)
258257
}
259258

260-
// VirtualSize shows the virtual size of the image and all of its parent
261-
// images. Starting with docker 1.10, images are self-contained, and
262-
// the VirtualSize is identical to Size.
263-
//
264-
// Deprecated: VirtualSize is deprecated, and equivalent to [imageContext.Size].
265-
func (c *imageContext) VirtualSize() string {
266-
return units.HumanSize(float64(c.i.Size))
267-
}
268-
269259
func (c *imageContext) SharedSize() string {
270260
if c.i.SharedSize == -1 {
271261
return "N/A"

cli/command/formatter/image_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ func TestImageContext(t *testing.T) {
6868
expValue: "10",
6969
call: ctx.Containers,
7070
},
71-
{
72-
imageCtx: imageContext{i: image.Summary{Size: 10000}},
73-
expValue: "10kB",
74-
call: ctx.VirtualSize, //nolint:nolintlint,staticcheck // ignore SA1019: field is deprecated, but still set on API < v1.44.
75-
},
7671
{
7772
imageCtx: imageContext{i: image.Summary{SharedSize: 10000}},
7873
expValue: "10kB",

docs/reference/commandline/image_ls.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,6 @@ To list all images in JSON format, use the `json` directive:
342342

343343
```console
344344
$ docker images --format json
345-
{"Containers":"N/A","CreatedAt":"2021-03-04 03:24:42 +0100 CET","CreatedSince":"5 days ago","Digest":"\u003cnone\u003e","ID":"4dd97cefde62","Repository":"ubuntu","SharedSize":"N/A","Size":"72.9MB","Tag":"latest","UniqueSize":"N/A","VirtualSize":"72.9MB"}
346-
{"Containers":"N/A","CreatedAt":"2021-02-17 22:19:54 +0100 CET","CreatedSince":"2 weeks ago","Digest":"\u003cnone\u003e","ID":"28f6e2705743","Repository":"alpine","SharedSize":"N/A","Size":"5.61MB","Tag":"latest","UniqueSize":"N/A","VirtualSize":"5.613MB"}
345+
{"Containers":"N/A","CreatedAt":"2021-03-04 03:24:42 +0100 CET","CreatedSince":"5 days ago","Digest":"\u003cnone\u003e","ID":"4dd97cefde62","Repository":"ubuntu","SharedSize":"N/A","Size":"72.9MB","Tag":"latest","UniqueSize":"N/A"}
346+
{"Containers":"N/A","CreatedAt":"2021-02-17 22:19:54 +0100 CET","CreatedSince":"2 weeks ago","Digest":"\u003cnone\u003e","ID":"28f6e2705743","Repository":"alpine","SharedSize":"N/A","Size":"5.61MB","Tag":"latest","UniqueSize":"N/A"}
347347
```

man/src/image/ls.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ Valid template placeholders are listed above.
114114
To list all images in JSON format you can use:
115115

116116
docker image ls --format json
117-
{"Containers":"N/A","CreatedAt":"2021-01-18 11:29:06 +0100 CET","CreatedSince":"24 hours ago","Digest":"\u003cnone\u003e","ID":"fbcf509fa16f","Repository":"docker","SharedSize":"N/A","Size":"235MB","Tag":"stable-dind","UniqueSize":"N/A","VirtualSize":"235.5MB"}
118-
{"Containers":"N/A","CreatedAt":"2021-01-18 11:24:48 +0100 CET","CreatedSince":"24 hours ago","Digest":"\u003cnone\u003e","ID":"08656a69ab2b","Repository":"docker-cli-e2e","SharedSize":"N/A","Size":"1.21GB","Tag":"latest","UniqueSize":"N/A","VirtualSize":"1.207GB"}
119-
{"Containers":"N/A","CreatedAt":"2021-01-18 10:43:44 +0100 CET","CreatedSince":"24 hours ago","Digest":"\u003cnone\u003e","ID":"abca5c07c1ba","Repository":"docker-cli-dev","SharedSize":"N/A","Size":"608MB","Tag":"latest","UniqueSize":"N/A","VirtualSize":"607.8MB"}
117+
{"Containers":"N/A","CreatedAt":"2021-01-18 11:29:06 +0100 CET","CreatedSince":"24 hours ago","Digest":"\u003cnone\u003e","ID":"fbcf509fa16f","Repository":"docker","SharedSize":"N/A","Size":"235MB","Tag":"stable-dind","UniqueSize":"N/A"}
118+
{"Containers":"N/A","CreatedAt":"2021-01-18 11:24:48 +0100 CET","CreatedSince":"24 hours ago","Digest":"\u003cnone\u003e","ID":"08656a69ab2b","Repository":"docker-cli-e2e","SharedSize":"N/A","Size":"1.21GB","Tag":"latest","UniqueSize":"N/A"}
119+
{"Containers":"N/A","CreatedAt":"2021-01-18 10:43:44 +0100 CET","CreatedSince":"24 hours ago","Digest":"\u003cnone\u003e","ID":"abca5c07c1ba","Repository":"docker-cli-dev","SharedSize":"N/A","Size":"608MB","Tag":"latest","UniqueSize":"N/A"}
120120

121121
## Listing only the shortened image IDs
122122

man/src/inspect.md

Lines changed: 59 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,6 @@ To get information on a container use its ID or instance name:
4242
},
4343
"Image": "ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4",
4444
"NetworkSettings": {
45-
"Bridge": "",
46-
"SandboxID": "6b4851d1903e16dd6a567bd526553a86664361f31036eaaa2f8454d6f4611f6f",
47-
"HairpinMode": false,
48-
"LinkLocalIPv6Address": "",
49-
"LinkLocalIPv6PrefixLen": 0,
50-
"Ports": {},
51-
"SandboxKey": "/var/run/docker/netns/6b4851d1903e",
52-
"SecondaryIPAddresses": null,
53-
"SecondaryIPv6Addresses": null,
54-
"EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d",
55-
"Gateway": "172.17.0.1",
56-
"GlobalIPv6Address": "",
57-
"GlobalIPv6PrefixLen": 0,
58-
"IPAddress": "172.17.0.2",
59-
"IPPrefixLen": 16,
60-
"IPv6Gateway": "",
61-
"MacAddress": "02:42:ac:12:00:02",
6245
"Networks": {
6346
"bridge": {
6447
"NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
@@ -71,8 +54,21 @@ To get information on a container use its ID or instance name:
7154
"GlobalIPv6PrefixLen": 0,
7255
"MacAddress": "02:42:ac:12:00:02"
7356
}
74-
}
75-
57+
},
58+
"Ports": {
59+
"80/tcp": [
60+
{
61+
"HostIp": "0.0.0.0",
62+
"HostPort": "8080"
63+
},
64+
{
65+
"HostIp": "::",
66+
"HostPort": "8080"
67+
}
68+
]
69+
},
70+
"SandboxID": "6b4851d1903e16dd6a567bd526553a86664361f31036eaaa2f8454d6f4611f6f",
71+
"SandboxKey": "/var/run/docker/netns/6b4851d1903e"
7672
},
7773
"ResolvConfPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/resolv.conf",
7874
"HostnamePath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hostname",
@@ -212,76 +208,47 @@ https://pkg.go.dev/text/template.
212208
Use an image's ID or name (e.g., repository/name[:tag]) to get information
213209
about the image:
214210

215-
$ docker inspect ded7cd95e059
216-
[{
217-
"Id": "ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4",
218-
"Parent": "48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731",
219-
"Comment": "",
220-
"Created": "2015-05-27T16:58:22.937503085Z",
221-
"Container": "76cf7f67d83a7a047454b33007d03e32a8f474ad332c3a03c94537edd22b312b",
222-
"ContainerConfig": {
223-
"Hostname": "76cf7f67d83a",
224-
"Domainname": "",
225-
"User": "",
226-
"AttachStdin": false,
227-
"AttachStdout": false,
228-
"AttachStderr": false,
229-
"ExposedPorts": null,
230-
"Tty": false,
231-
"OpenStdin": false,
232-
"StdinOnce": false,
233-
"Env": null,
234-
"Cmd": [
235-
"/bin/sh",
236-
"-c",
237-
"#(nop) ADD file:4be46382bcf2b095fcb9fe8334206b584eff60bb3fad8178cbd97697fcb2ea83 in /"
238-
],
239-
"Image": "48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731",
240-
"Volumes": null,
241-
"VolumeDriver": "",
242-
"WorkingDir": "",
243-
"Entrypoint": null,
244-
"NetworkDisabled": false,
245-
"MacAddress": "",
246-
"OnBuild": null,
247-
"Labels": {}
248-
},
249-
"DockerVersion": "1.6.0",
250-
"Author": "Lokesh Mandvekar \[email protected]\u003e",
251-
"Config": {
252-
"Hostname": "76cf7f67d83a",
253-
"Domainname": "",
254-
"User": "",
255-
"AttachStdin": false,
256-
"AttachStdout": false,
257-
"AttachStderr": false,
258-
"ExposedPorts": null,
259-
"Tty": false,
260-
"OpenStdin": false,
261-
"StdinOnce": false,
262-
"Env": null,
263-
"Cmd": null,
264-
"Image": "48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731",
265-
"Volumes": null,
266-
"VolumeDriver": "",
267-
"WorkingDir": "",
268-
"Entrypoint": null,
269-
"NetworkDisabled": false,
270-
"MacAddress": "",
271-
"OnBuild": null,
272-
"Labels": {}
273-
},
274-
"Architecture": "amd64",
275-
"Os": "linux",
276-
"Size": 186507296,
277-
"VirtualSize": 186507296,
278-
"GraphDriver": {
279-
"Data": {
280-
"LowerDir": "/var/lib/docker/overlay2/44b1d1f04db6b1b73a86f9a62678673bf5d16d9a6b62c13e859aa34a99cce5ea/diff:/var/lib/docker/overlay2/ef637181eb13e30e84b7382183364ed7fd7ff7be22d8bb87049e36b75fb89a86/diff:/var/lib/docker/overlay2/64fb0f850b1289cd09cbc3b077cab2c0f59a4f540c67f997b094fc3652b9b0d6/diff:/var/lib/docker/overlay2/68c4d1411addc2b2bd07e900ca3a059c9c5f9fa2607efd87d8d715a0080ed242/diff",
281-
"MergedDir": "/var/lib/docker/overlay2/c7846fe68c6f18247ab9b8672114dde9f506bc164081a895c465716eeb10f2bc/merged",
282-
"UpperDir": "/var/lib/docker/overlay2/c7846fe68c6f18247ab9b8672114dde9f506bc164081a895c465716eeb10f2bc/diff",
283-
"WorkDir": "/var/lib/docker/overlay2/c7846fe68c6f18247ab9b8672114dde9f506bc164081a895c465716eeb10f2bc/work"
284-
},
285-
"Name": "overlay2"
286-
}
287-
}]
211+
docker inspect hello-world
212+
[
213+
{
214+
"Id": "sha256:54e66cc1dd1fcb1c3c58bd8017914dbed8701e2d8c74d9262e26bd9cc1642d31",
215+
"RepoTags": [
216+
"hello-world:latest"
217+
],
218+
"RepoDigests": [
219+
"hello-world@sha256:54e66cc1dd1fcb1c3c58bd8017914dbed8701e2d8c74d9262e26bd9cc1642d31"
220+
],
221+
"Parent": "",
222+
"Comment": "buildkit.dockerfile.v0",
223+
"Created": "2025-08-08T19:05:17Z",
224+
"DockerVersion": "",
225+
"Author": "",
226+
"Config": {
227+
"Env": [
228+
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
229+
],
230+
"Cmd": [
231+
"/hello"
232+
],
233+
"WorkingDir": "/"
234+
},
235+
"Architecture": "arm64",
236+
"Variant": "v8",
237+
"Os": "linux",
238+
"Size": 16963,
239+
"RootFS": {
240+
"Type": "layers",
241+
"Layers": [
242+
"sha256:50163a6b11927e67829dd6ba5d5ba2b52fae0a17adb18c1967e24c13a62bfffa"
243+
]
244+
},
245+
"Metadata": {
246+
"LastTagTime": "2025-09-30T14:06:24.148634215Z"
247+
},
248+
"Descriptor": {
249+
"mediaType": "application/vnd.oci.image.index.v1+json",
250+
"digest": "sha256:54e66cc1dd1fcb1c3c58bd8017914dbed8701e2d8c74d9262e26bd9cc1642d31",
251+
"size": 12341
252+
}
253+
}
254+
]

0 commit comments

Comments
 (0)