Repository navigation
Drop the base image's unused parts (~800 MB smaller) - #50
Merged
Merged
Conversation
89% of the image is one baseimage-selkies layer, which ships Docker-in- Docker, the C/C++ toolchain, hundreds of compiled locales and CJK serif fonts that ConnectHub never uses. Deleting them in a later layer can't shrink the image, so a build stage removes them and its filesystem is copied into a fresh image. - slim_base.sh purges only installed packages (Docker is amd64-only) and refuses if apt would take a package the base installs on purpose - the base's ENV/ENTRYPOINT are re-declared; check_base_env.sh fails the build if they drift from the base image - START_DOCKER=false; a final smoke test checks the session's binaries, Selkies' Python packages and the en_US.UTF-8 locale Fixes #49 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BuildKit sets TRACEPARENT (and TRACESTATE) to a new value in every RUN, so the base image's recorded value could never match and the build failed. Also report every mismatch at once instead of stopping at the first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #49
What changed
slimrunsscripts/slim_base.shonbaseimage-selkies: purges Docker-in-Docker (amd64 only), gcc/g++/cmake/make/git andlocales-all, regenerates onlyen_US.UTF-8, removes the Noto CJK serif fonts, and cleans apt state. It purges only installed packages, and refuses if apt would also remove a package the base installs on purpose (apt-mark showmanual).FROM scratchand copies the slim stage's filesystem, since deleting files in a later layer can't shrink an image. The base image'sENVandENTRYPOINTare re-declared;scripts/check_base_env.shfails the build if they drift from the base.START_DOCKER=false(the base'ssvc-dockerthen just sleeps).en_US.UTF-8locale.python3-pip(the venv brings its own pip). README: new "Image Size" section.Update size
The slim layer depends only on the base image and
slim_base.sh, so CI's GHA layer cache keeps it, and its digest, unchanged between ConnectHub releases: updates still download only ConnectHub's layers. A cache miss (eviction) produces a new slim layer and one full download.Testing
check_base_env.shtested in WSL: accepts a matching environment, rejects a changed value, a missing variable and aPATHnot ending in the base's.sha-09c95c9); results to follow in a comment.🤖 Generated with Claude Code