Skip to content
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

Docker reports probably incorrect size #45180

Open
manugupt1 opened this issue Mar 19, 2023 · 0 comments
Open

Docker reports probably incorrect size #45180

manugupt1 opened this issue Mar 19, 2023 · 0 comments
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

Comments

@manugupt1
Copy link

manugupt1 commented Mar 19, 2023

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

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Path:     /home/manu/.docker/cli-plugins/docker-buildx
  scan: Docker Scan (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-scan
WARNING: Plugin "/home/manu/.docker/cli-plugins/docker-compose" is not valid: failed to fetch metadata: fork/exec /home/manu/.docker/cli-plugins/docker-compose: no such file or directory

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 8
 Server Version: 23.0.1
 Storage Driver: btrfs
  Btrfs: 
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2456e983eb9e37e47538f59ea18f2043c9a73640
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.1.18-200.fc37.x86_64
 Operating System: Fedora Linux 37 (Workstation Edition)
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 31.13GiB
 Name: fedora
 ID: JOQG:NR3U:MVCI:FGKM:KFOI:Z4LD:X46B:SMA4:V7ML:YIW7:GFF5:E2KI
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional Info

Unfortunately, Right now; nerdctl does not show image size in bytes.

@manugupt1 manugupt1 added kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/0-triage labels Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants