slimtoolkit / slimtoolkit/slim

Including / as a path causes image to be 3X Bigger

Open
#197 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
Go
Stars
23.4k
Forks
840
PR merge metrics
No merged PRs in 30d

Description

Expected/Actual Behavior

When I include / as a path, I would expect the container to be the same size. Including / as a path causes a 272MB container to turn into a 943MB container. I tested this because I noticed that even only including a couple paths causes the image to grow significantly.


Steps to Reproduce the Problem

--http-probe=false --exec 'docker --version' --preserve-path-file 'paths.txt' and /

I'm opening this ticket mainly to get a better understanding of what docker-slim is doing to make the image bigger. I also would like to use the information to make my containers smaller. Anytime a container needs to have a lot of paths included, the container doesn't seem to get optimized a lot. This issue is especially the case when including stuff like /usr/lib/node_modules which might have a lot of files in it.

Will I have better luck using --include-bin-file or --include-path-file? I'm not really sure what the differences are between the different types of include/preserves. Or is it better to just use --exec and let DockerSlim do its thing instead of including paths?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with --http-probe=false --exec 'docker --version' --preserve-path-file 'paths.txt' and a paths.txt entry of /. Compare the resulting image sizes and investigate how the preserve and include options treat / and large paths such as /usr/lib/node_modules. Done means explaining the size increase and clarifying when to use --include-bin-file, --include-path-file, path preservation, or only --exec.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
devops, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.