[
{
"Id": "sha256:5fbf6884916b3cb9b4fd34e322553befe10df7ad285d217d06cd0dfe1754153e",
"RepoTags": [
"tmp-deb-full:latest"
],
"RepoDigests": [],
"Parent": "sha256:fa5df1ab58fe6d662ddefe3a92d9bb8a34f685e45de6ab1812ab37b880cc5a74",
"Comment": "",
"Created": "2021-05-12T05:50:53.620376318Z",
"Container": "ff4ab78243d481861dc73a740b8e3217b713dd603d5656a114139ba84f8992b4",
"ContainerConfig": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/bin/sh",
"-c",
"apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y devscripts cli-common-dev sbuild"
],
"Image": "sha256:fa5df1ab58fe6d662ddefe3a92d9bb8a34f685e45de6ab1812ab37b880cc5a74",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": null
},
"DockerVersion": "20.10.2",
"Author": "",
"Config": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"bash"
],
"Image": "sha256:fa5df1ab58fe6d662ddefe3a92d9bb8a34f685e45de6ab1812ab37b880cc5a74",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": null
},
"Architecture": "amd64",
"Os": "linux",
"Size": 999517084,
"VirtualSize": 999517084,
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/9074e34a9e7c1509ee5fe460707f6b18ed4398a484c359e716a7cd2e0c41d039/diff:/var/lib/docker/overlay2/fb68e8329c72acc7836a2a28400c387527f8ffad147962373dacb8052df2c13a/diff",
"MergedDir": "/var/lib/docker/overlay2/ef54d02d58c48a2d89cbe9d63026ca554177fe115690896e2c9731045159055b/merged",
"UpperDir": "/var/lib/docker/overlay2/ef54d02d58c48a2d89cbe9d63026ca554177fe115690896e2c9731045159055b/diff",
"WorkDir": "/var/lib/docker/overlay2/ef54d02d58c48a2d89cbe9d63026ca554177fe115690896e2c9731045159055b/work"
},
"Name": "overlay2"
},
"RootFS": {
"Type": "layers",
"Layers": [
"sha256:ae0a22915636881ac7024d0fcf1d828d913a6cb0b243baa1d20fead12be078a7",
"sha256:2ab3f25d2804db9d2956cf35119c667aa794bce981ba0b590efe1291d7469e42",
"sha256:1adc272ccaf3b3dc95e69f351db9a509d0ea607df07c8cdc6e226ee95ae32210"
]
},
"Metadata": {
"LastTagTime": "2021-05-12T12:50:54.522154763+07:00"
}
}
]
Description
When creating a Docker image that was almost, but not quite, 1 billion bytes in size, I noticed that
docker image lsreported the size as1e+03MBinstead of 1000MB or 1.0GB. I figure that what happened is that the image was less than 1000MB so it didn't get reported as 1.0GB, but then since it was more than 999.5MB, it didn't get reported as 999MB either. This isn't really a problem for me, but it was slightly jarring, and I could conceive of a possible issue where someone's script designed to parse the output ofdocker image lsmight barf on an unexpected format for image size.I did not find any duplicate issues reporting this, probably because it's rare to actually trigger the conditions for this to happen, so I figured I'd report it so that someone can figure out a fix.
Steps to reproduce the issue:
docker image ls1e+03MBDescribe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
My Dockerfile that produced this result:
I ran this on 2021-05-12 around 06:00 UTC. Reproducing the exact image I produced might be difficult since any new packages uploaded to Debian sid (whcih gets new packages uploaded all the time) would very likely have a different size and end up with a different image size, and I suspect the bug is triggered only when image size is >= 999.5MB and < 1000.0MB. Therefore, I preserved the image in question with
docker image save. The .tar.xz file is 275 MB, so I won't attach it to this issue, but I can upload it somewhere and make it available on request, if anyone needs it. (Though I suspect one could repro this issue by creating an image full of zero bytes, so you may not need it.)I've also included the output of
docker image inspectbelow in case it helps.Output of
docker image inspectOutput of
docker version:Output of
docker info:Additional environment details (AWS, VirtualBox, physical, etc.):