Repository navigation
build: Optimize Dockerfiles - #8
Closed
TrueSkrillor wants to merge 1 commit into
Closed
TrueSkrillor wants to merge 1 commit into
TrueSkrillor wants to merge 1 commit into
Conversation
Contributor
Author
|
Moving to -Development |
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.
Came across this while setting up dedicated Jenkins workers. I asked Claude to optimize the images in terms of build time, image size and layer count (best practice level, not aggressively). The results are compelling, the resulting binaries are byte-identical. Here's a quick comparison for a few images that Claude tested:
Total size of the 22 sampled images: 4457 MB → 3825 MB (−632 MB)
Build times without a mark come from a sequential run (one build at a time, before and after alternating).
¹ marks images built in a parallel run with 6 concurrent builds: compare those only with each other. Builds that are still serial, like OpenSSL < 1.1.0 or wolfSSL (mostly clone, autogen and configure), are unchanged within noise. Firefox and NSS spend most of their time downloading, so those differences are network noise. Sizes are as reported by
docker image inspect.² The original
mbedtls_x2build never finished (aborted after more than 16 min). 1m 32s is the original Dockerfile with only thejsonschemapin applied.