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 cp success message shows wrong size #5777

Open
liefke opened this issue Jan 29, 2025 · 0 comments
Open

Docker cp success message shows wrong size #5777

liefke opened this issue Jan 29, 2025 · 0 comments

Comments

@liefke
Copy link

liefke commented Jan 29, 2025

Description

As described in https://stackoverflow.com/questions/79394678/why-is-the-size-in-the-success-message-of-docker-cp-wrong the success message of docker cp doesn't tell the real size of the transferred file, but the size of the transferred tarball. As the user usually isn't aware of the implementation, the given size sends the user on the wrong track.

Reproduce

Run docker cp with a file that has a well known size and check the result message:

docker cp empty-file my-container:/empty-file
Successfully copied 1.54kB to ...

Observed behavior: The size in the result message is always greater than the size of the copied file.

Expected behavior

The result message should either show the correct size, should describe why the size is greater (Successfully copied a tarball of 1.54kB to ...), or should not contain the size at all.

docker version

Client: Docker Engine - Community
 Version:           27.5.1
 API version:       1.47
 Go version:        go1.22.11
 Git commit:        9f9e405
 Built:             Wed Jan 22 13:42:47 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.5.1
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.11
  Git commit:       4c9b3b0
  Built:            Wed Jan 22 13:41:09 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.25
  GitCommit:        bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
 runc:
  Version:          1.2.4
  GitCommit:        v1.2.4-0-g6c52b3f
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client: Docker Engine - Community
 Version:    27.5.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.20.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.32.4
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Additional Info

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant