slimtoolkit / slimtoolkit/slim

Fat git-core catalog after slim

Open
#343 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected Behavior

Image smaller than fat


Actual Behavior

cmd=build info=results status='MINIFIED' by='0.77X' size.original='461 MB' size.optimized='599 MB'


Steps to Reproduce the Problem

FROM hashicorp/terraform:latest as terraform
RUN apk --no-cache --update add bash git python3 py-pip docker
RUN pip install --no-cache-dir pre-commit
ENTRYPOINT ["/bin/bash"]

docker-slim build --remove-file-artifacts --preserve-path /usr/libexec/git-core/ --exec "git init" --http-probe=false -target test --tag test-slim

Fat image:

bash-5.1# du -shc /usr/libexec/git-core/
9.4M    /usr/libexec/git-core/
9.4M    total

Slim image:

bash-5.1# du -shc /usr/libexec/git-core/
386.5M  /usr/libexec/git-core/
386.5M  total

Why /usr/libexec/git-core/ don't copy dir from fat image?

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 issue with the shown Terraform-based Dockerfile and docker-slim build command, then compare /usr/libexec/git-core/ in the fat and slim images. Start by tracing how --preserve-path handles this directory; done means the slim image preserves its original size rather than expanding it to 386.5 MB.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, git
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.