Skip to content

Commit 66b0c93

Browse files
kvapsclaude
andcommitted
fix(docker): explicit blacklist .dockerignore so cmd/ + pkg/ ship
The previous policy ignored everything via ** and re-included via !**/*.go. Docker's wildcard handling drops directory entries when the parent is ignored, so the build context arrived empty of cmd/. Switch to an explicit blacklist (.git, bin/, .work/, _test.go, testdata/, docs/, IDE noise) so the whole Go source tree lands. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
1 parent 56bef8f commit 66b0c93

1 file changed

Lines changed: 25 additions & 7 deletions

File tree

.dockerignore

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
11
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2-
# Ignore everything by default and re-include only needed files
3-
**
2+
#
3+
# Strategy: ignore everything heavy (.git, build artefacts, dev-stand
4+
# scratch, IDE files), then keep the Go source tree + module files. We
5+
# *don't* try to whitelist via `!` from a global `**` — that confuses
6+
# Docker about directory traversal. Explicit blacklist of known-noisy
7+
# paths is reviewable and unambiguous.
48

5-
# Re-include Go source files (but not *_test.go)
6-
!**/*.go
9+
# Source-control + build outputs
10+
.git
11+
.gitignore
12+
bin/
13+
dist/
14+
.work/
15+
16+
# Tests + scratch we never need in the image
717
**/*_test.go
18+
**/testdata/
19+
20+
# Local notes / docs that would balloon the build context
21+
.claude/
22+
docs/
23+
*.md
824

9-
# Re-include Go module files
10-
!go.mod
11-
!go.sum
25+
# IDE / editor noise
26+
.vscode/
27+
.idea/
28+
*.swp
29+
.DS_Store

0 commit comments

Comments
 (0)