From 967e5e262e3da16c501f1312cf24f12efd015874 Mon Sep 17 00:00:00 2001 From: Eric Fitzgerald Date: Thu, 30 Jul 2026 23:22:40 -0400 Subject: [PATCH] chore(build): keep terraform and regenerable output out of the docker context `docker build` failed outright with "no space left on device" while copying terraform-provider-aws into the build context. .dockerignore excluded test/results/ and test/outputs/ but nothing else that had grown large, so the context was 4.71 GB, most of it files no image has ever needed. `terraform init` caches provider binaries under .terraform/ -- 4.3 GB across eight directories on a machine that has init'd every environment (aws-public alone is 1.6 GB). No Dockerfile references terraform/, so the whole tree is excluded rather than just **/.terraform/; that also keeps it from regrowing the next time a new environment is init'd. test/postman/test-results/ is another ~400 MB of newman output. It is already gitignored and regenerable -- the same class as test/results/, which carries the same comment about the context having reached 14 GB. The collections themselves are tracked source and stay in the context. node_modules/, coverage/, coverage_html/ and .dedupe/ round it out: all regenerable, none referenced by any Dockerfile. Measured with a `FROM scratch` + `COPY . /ctx` probe on a fresh buildx builder, so the numbers are full context transfers rather than BuildKit deltas: before 4.71 GB build FAILS, no space left on device after 673 MB build succeeds The "before" run reproduced the original failure exactly, dying on terraform-provider-oci_v8.5.0. Verified `make build-server-container` still succeeds on the reduced context, so nothing an image actually needs was excluded. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01WnrVyySuyJFqcMxB8q3pNc --- .dockerignore | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.dockerignore b/.dockerignore index b5134c88..5462180d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -83,5 +83,28 @@ test/outputs/ # test/outputs/ in the cats-plugin migration but the exclusion was never # carried over, so the build context had grown to 14 GB. test/results/ +# test/postman/test-results/ is newman run output (~400 MB), already gitignored +# and regenerable -- same class as test/results/ above. The collections +# themselves are tracked source and stay in the context. +test/postman/test-results/ security-reports/ *.backup + +# Infrastructure-as-code. No Dockerfile references terraform/, and `terraform +# init` caches provider binaries under .terraform/ -- 4.3 GB across eight +# directories on a machine that has init'd every environment (aws-public alone +# is 1.6 GB). That was enough to fail `docker build` outright with "no space +# left on device" while copying terraform-provider-aws into the context. +# Excluding the whole tree, not just **/.terraform/, keeps it from regrowing +# the next time a new environment is init'd. +terraform/ + +# Node dependencies: regenerable from package-lock.json and not referenced by +# any Dockerfile (no image runs a JS build). +node_modules/ + +# Coverage and tooling caches -- regenerable test output, same rationale as +# test/outputs/ above. +coverage/ +coverage_html/ +.dedupe/