-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image size reported as 1e+03MB by docker image ls
#3091
Comments
Still occurs with Docker 20.10.8, running on Ubuntu 21.10. Output of
|
I second this, not a big deal but looks weird.
|
Just saw this on my Manjaro Linux machine:
|
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. |
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
docker image inspect
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: