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

Wasted space in image #402

Closed
vflaux opened this issue Mar 7, 2023 · 1 comment · Fixed by #600
Closed

Wasted space in image #402

vflaux opened this issue Mar 7, 2023 · 1 comment · Fixed by #600

Comments

@vflaux
Copy link

vflaux commented Mar 7, 2023

37MB is wasted here as the COPY layer is completely overlayed by the RUN chmod one:

COPY containerd-nydus-grpc /usr/local/bin/
RUN chmod +x /usr/local/bin/containerd-nydus-grpc

Should use COPY --chmod instead from buildkit.

Dive output:

Analyzing image...
  efficiency: 74.4988 %
  wastedBytes: 73633235 bytes (74 MB)
  userWastedPercent: 53.6183 %
Inefficient Files:
Count  Wasted Space  File Path
    2         74 MB  /usr/local/bin/containerd-nydus-grpc
    2         30 kB  /lib/apk/db/installed
    2         22 kB  /lib/apk/db/scripts.tar
    2         152 B  /lib/apk/db/triggers
    2         131 B  /etc/apk/world
@changweige
Copy link
Member

Thanks for reporting. Could please help raise a PR to fix it?

SToPire added a commit to SToPire/nydus-snapshotter that referenced this issue Jul 2, 2024
Let's use Docker's `COPY --chmod` feature instead of using a separate
chmod command. This will reduce the generated image size by ~12KB.

Fixes: containerd#402

Signed-off-by: Yifan Zhao <zhaoyifan@sjtu.edu.cn>
@imeoer imeoer closed this as completed in f646a17 Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants