Open rmunn opened 3 years ago
Still occurs with Docker 20.10.8, running on Ubuntu 21.10.
docker version
on my Ubuntu 21.10 test VM:docker info
on my Ubuntu 21.10 test VM:I second this, not a big deal but looks weird.
➜ docker --version
Docker version 20.10.17, build 100c701
➜ uname -a
Linux blackstar 5.4.0-107-generic #121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
➜ git:(master) docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nvidia/nvidia-driver-flatcar 470.103.01 0931e1f8d96c 50 minutes ago 1e+03MB
Just saw this on my Manjaro Linux machine:
Docker version 23.0.1, build a5ee5b1dfc
Client:
Version: 23.0.1
API version: 1.42
Go version: go1.20
Git commit: a5ee5b1dfc
Built: Sat Feb 11 13:58:04 2023
OS/Arch: linux/amd64
Context: default
Server:
Engine:
Version: 23.0.1
API version: 1.42 (minimum version 1.12)
Go version: go1.20
Git commit: bc3805a0a0
Built: Sat Feb 11 13:58:04 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.6.16
GitCommit: 31aa4358a36870b21a992d3ad2bef29e1d693bec.m
runc:
Version: 1.1.4
GitCommit:
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Hi, I'd like to give this a go. I already made a sample image to reproduce it and I'm setting up the environment
I hope fixing this issue on docker go-units fixes this.
Hi, I'm from the UT Austin virtualization class, and as part of our open-source project, I'd like to take on this issue if possible. Given that it is labeled as a beginner issue, it would fit into my current open-source contribution experience. Thanks!
Description
When creating a Docker image that was almost, but not quite, 1 billion bytes in size, I noticed that
docker image ls
reported the size as1e+03MB
instead 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 ls
might 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 ls
1e+03MB
Describe 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 inspect
below in case it helps.Output of
``` [ { "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" } } ] ```docker image inspect
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):