Skip to content

perf(docker): add .dockerignore so the build context stops shipping .git - #321

Open
Harshithraj24 wants to merge 1 commit into
mainfrom
perf/add-dockerignore
Open

Harshithraj24 wants to merge 1 commit into
mainfrom
perf/add-dockerignore

Conversation

@Harshithraj24

@Harshithraj24 Harshithraj24 commented Sep 29, 2026 •

Copy link
Copy Markdown

Small cleanup, not the big win — worth being clear about that up front.

We have no .dockerignore, so COPY . . ships the whole build context. The large part of that was .git, but the GitHub Actions workflow already checks out with fetch-depth: 1, so once transpiler builds move there the history is gone anyway. 3.0.1011 shows it: that build's COPY . . layer is 39 MB against 515 MB on the Jenkins-built 3.0.211.

What fetch-depth: 1 doesn't remove is everything else we don't need at runtime — docs/ is 80 MB in the tree, plus tests/, 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.txt and sqlglotrs/ in the context since the build needs them. Also checked that dropping .git doesn't break versioning — nothing here runs pip install ., and sqlglotrs takes its version from Cargo.toml.

Not built locally (no Docker on my machine), so worth a glance at the layer sizes on the first CI build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant