Docker reports probably incorrect size #45180
Labels
kind/bug
Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
status/0-triage
version/23.0
Description
I was comparing image sizes with nerdctl images. Both of them report different sizes. Docker reports slightly less size in bytes.
Image 1:
ghcr.io/containerd/busybox 1.28
Docker 1146369
Nerdctl 1167360
Image 2:
minio/minio latest
Docker: 254473318
Nerdctl: 261423104
The busybox image has only 1 layer with sha on
docker inspect ghcr.io/containerd/busybox:1.28
sha256:432b65032b9466b4dadcc5c7b11701e71d21c18400aae946b101ad16be62333a
So, the size should ideally be the same or more. I am unable to understand why the size is less on Docker. Nerdctl uses the following code: https://github.com/containerd/nerdctl/blob/8a9bdf30fca7410b7293dd90113fbde0b1b23c45/pkg/imgutil/imgutil.go#L404-L430 where it adds the usage size of all the diffids.
Reproduce
docker inspect <...>
Expected behavior
Expected docker size to be at least as same as nerdctl's
docker version
Client: Docker Engine - Community Version: 23.0.1 API version: 1.42 Go version: go1.19.5 Git commit: a5ee5b1 Built: Thu Feb 9 19:49:42 2023 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 23.0.1 API version: 1.42 (minimum version 1.12) Go version: go1.19.5 Git commit: bc3805a Built: Thu Feb 9 19:46:53 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.18 GitCommit: 2456e983eb9e37e47538f59ea18f2043c9a73640 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
Unfortunately, Right now; nerdctl does not show image size in bytes.
The text was updated successfully, but these errors were encountered: