Skip to content

Commit 8c39c72

Browse files
authored
fix: Docker build fails with no space left on device (#3294)
## Problem `make test-container-proxy` fails on all 8 tests because the Docker build runs out of disk space: ``` [builder 6/7] RUN go mod tidy -> unzip gonum.org/v1/gonum@v0.17.0: no space left on device ``` Two issues: 1. **`go mod tidy` in Dockerfile** downloads all transitive test dependencies (gonum 500MB+ via OpenTelemetry → gRPC chain), exhausting Docker's disk 2. **No `.dockerignore`** — `COPY . .` copies 521MB of Rust `target/` build artifacts into the build context ## Fix - **Remove `go mod tidy` from Dockerfile**: `go.mod`/`go.sum` are already committed tidy, so `go mod download` + `go build` is sufficient. CI and linting already enforce tidy modules. - **Add `.dockerignore`**: Excludes Rust `target/`, `.git/`, test directories, and build artifacts from the Docker build context. ## Verification All 8 container proxy tests pass after the fix (7 PASS, 1 SKIP on macOS): ``` --- PASS: TestContainerProxyBuildAndStart --- PASS: TestContainerProxyTLSCertificates --- PASS: TestContainerProxyAuthForwarding --- PASS: TestContainerProxyGuardAutoDetect --- PASS: TestContainerProxyDIFCEnforcement --- PASS: TestContainerProxyLogs --- PASS: TestContainerProxyUntrustedTLS --- SKIP: TestContainerProxyGhCLI (macOS CA trust) ``` `make agent-finished` also passes.
2 parents 3ad1531 + 7efa9c1 commit 8c39c72

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

.dockerignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Rust build artifacts (500MB+)
2+
guards/github-guard/rust-guard/target/
3+
4+
# Test directories
5+
test/
6+
.github/
7+
8+
# Git metadata
9+
.git/
10+
11+
# Build artifacts
12+
awmg
13+
mcpg
14+
*.test
15+
*.out
16+
coverage.*
17+
18+
# Runtime/dev files
19+
.env
20+
.env.*
21+
.DS_Store
22+
.serena/

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ RUN go mod download
99

1010
# Copy source code
1111
COPY . .
12-
RUN go mod tidy
1312

1413
# Build argument for version (defaults to "dev")
1514
ARG VERSION=dev

0 commit comments

Comments
 (0)