Repository navigation
perf(docker): add .dockerignore so the build context stops shipping .git - #321
Open
Harshithraj24 wants to merge 1 commit into
Open
Harshithraj24 wants to merge 1 commit into
Harshithraj24 wants to merge 1 commit into
Conversation
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.
Small cleanup, not the big win — worth being clear about that up front.
We have no
.dockerignore, soCOPY . .ships the whole build context. The large part of that was.git, but the GitHub Actions workflow already checks out withfetch-depth: 1, so once transpiler builds move there the history is gone anyway.3.0.1011shows it: that build'sCOPY . .layer is 39 MB against 515 MB on the Jenkins-built3.0.211.What
fetch-depth: 1doesn't remove is everything else we don't need at runtime —docs/is 80 MB in the tree, plustests/,posts/,benchmarks/and the README images. That's the remaining 39 MB layer, where the runtime tree is under 1 MB.So this is worth roughly 38 MB per build, not the 500 MB you'd get from the checkout depth. It's free and it belongs in the repo rather than in CI config, but it isn't urgent.
Kept
requirements.txtandsqlglotrs/in the context since the build needs them. Also checked that dropping.gitdoesn't break versioning — nothing here runspip install ., andsqlglotrstakes its version fromCargo.toml.Not built locally (no Docker on my machine), so worth a glance at the layer sizes on the first CI build.