Skip to content

Commit 7efa9c1

Browse files
lpcoxCopilot
andcommitted
fix: Docker build fails with no space left on device
Remove redundant 'go mod tidy' from Dockerfile — go.mod/go.sum are already committed tidy, so 'go mod download' + 'go build' is sufficient. The tidy step downloaded huge transitive test deps (gonum 500MB+ via OpenTelemetry → gRPC chain) that exhausted Docker's disk. Add .dockerignore to exclude Rust target/ (521MB), .git/, and test directories from the build context, further reducing image build size and preventing COPY disk exhaustion. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 99f61b1 commit 7efa9c1

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)