Skip to content

ctr displays the wrong image size when images are very smallΒ #9641

@gesarki

Description

@gesarki

Description

ctr reports the wrong image size for small images, I believe < 1KiB in size.

Steps to reproduce the issue

  1. Pull a very small docker image with docker and then with ctr, e.g. https://hub.docker.com/layers/warmmetal/csi-image-test/simple-fs/images/sha256-6242a1b1a6de62107af0d2aa3cc80808e15fe1720e80e813ed25e99dc9631a27 (built from here)
  2. run docker image ls and check the size of the downloaded image.
  3. run ctr image ls and check the size of the downloaded image

Describe the results you received and expected

ctr reports 3.1 KiB, while docker reports a more realistic 37 Bytes.
I know docker and ctr's implementations are different based on #9261, which says docker reports the uncompressed size and ctr shows compressed, but in this case ctr is reporting a larger size than docker by a significant amount.

What version of containerd are you using?

1.6.25 d8f198a

Any other relevant information

runc version 1.1.10
commit: v1.1.10-0-g18a0cb0
spec: 1.0.2-dev
go: go1.20.10
libseccomp: 2.5.4

Linux 75b012314615 6.5.0-14-generic #14-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 14 14:59:49 UTC 2023 x86_64 GNU/Linux

Show configuration if it is related to CRI plugin.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions