docker / hub-feedback

Feedback and bug reports for the Docker Hub
https://hub.docker.com
233 stars 48 forks source link

Pulling a docker image, progress info is inconsistent with Dockerhub image size #2334

Open szabi opened 11 months ago

szabi commented 11 months ago

Description

Both DockerHub and the download progress info when executing "docker build" and pulling an image display "GB".

However, when doing "docker build" from a Dockerfile, the CLI displays indeed true Gigabytes, but DockerHub, while also using "GB" as a unit, is actually providing Gibibytes.

Example:

https://hub.docker.com/layers/pytorch/pytorch/2.0.1-cuda11.7-cudnn8-runtime/images/sha256-82e0d379a5dedd6303c89eda57bcc434c40be11f249ddfadfd5673b84351e806?context=explore is displayed as having "2.93 GB" size.

When building an image, download progresses above 2.93, and the process finishes when it reaches 3.14 GB.

Where does the discrepancy come from? The numbers are consistent with 3.14 GB = 2.93 GiB. (but note that DockerHub incorrectly displays GB as a unit).

Reproduce

  1. go to https://hub.docker.com/layers/pytorch/pytorch/2.0.1-cuda11.7-cudnn8-runtime/images/sha256-82e0d379a5dedd6303c89eda57bcc434c40be11f249ddfadfd5673b84351e806?context=explore, note the displayed size (supposedly in "GB"). (='2.93 GB')

  2. build an image with a dockerfile FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime

    • note the final number when displaying progress in GB. (='3.14 GB')

Expected behavior

To make the experience consistent and not make the user puzzle ("why is it still downloading? We are exceeding image size!"), either:

docker version

Client:
 Cloud integration: 1.0.17
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.16.4
 Git commit:        f0df350
 Built:             Wed Jun  2 12:00:56 2021
 OS/Arch:           windows/amd64
 Context:           desktop-linux
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       b0f5bc3
  Built:            Wed Jun  2 11:54:58 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.6
  GitCommit:        d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc:
  Version:          1.0.0-rc95
  GitCommit:        b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  compose: Docker Compose (Docker Inc., 2.0.0-beta.4)
  scan: Docker Scan (Docker Inc., v0.8.0)

Additional Info

No response

vvoland commented 11 months ago

It's probably going to be a breaking change to change the output on the CLI. Perhaps a better solution would be to change it on the Docker Hub side like you said. Let me transfer this issue to the Docker Hub issue tracker directly.

szabi commented 11 months ago

The original issue description was filled for CLI, thanks @thaJeztah for transferring.

On the Hub the solution could be to change