File tree Expand file tree Collapse file tree 14 files changed +84
-42
lines changed
cronjob-tutorial/testdata/project
getting-started/testdata/project
multiversion-tutorial/testdata/project
pkg/plugins/golang/v4/scaffolds/internal/templates Expand file tree Collapse file tree 14 files changed +84
-42
lines changed Original file line number Diff line number Diff line change 11# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2- # Ignore build and test binaries.
3- bin /
2+ # Ignore everything by default and re-include only needed files
3+ **
4+
5+ # Re-include Go source files (but not *_test.go)
6+ ! ** /* .go
7+ ** /* _test.go
8+
9+ # Re-include Go module files
10+ ! go.mod
11+ ! go.sum
Original file line number Diff line number Diff line change @@ -11,10 +11,8 @@ COPY go.sum go.sum
1111# and so that source changes don't invalidate our downloaded layer
1212RUN go mod download
1313
14- # Copy the go source
15- COPY cmd/main.go cmd/main.go
16- COPY api/ api/
17- COPY internal/ internal/
14+ # Copy the Go source (relies on .dockerignore to filter)
15+ COPY . .
1816
1917# Build
2018# the GOARCH has no default value to allow the binary to be built according to the host where the command
Original file line number Diff line number Diff line change 11# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2- # Ignore build and test binaries.
3- bin /
2+ # Ignore everything by default and re-include only needed files
3+ **
4+
5+ # Re-include Go source files (but not *_test.go)
6+ ! ** /* .go
7+ ** /* _test.go
8+
9+ # Re-include Go module files
10+ ! go.mod
11+ ! go.sum
Original file line number Diff line number Diff line change @@ -11,10 +11,8 @@ COPY go.sum go.sum
1111# and so that source changes don't invalidate our downloaded layer
1212RUN go mod download
1313
14- # Copy the go source
15- COPY cmd/main.go cmd/main.go
16- COPY api/ api/
17- COPY internal/ internal/
14+ # Copy the Go source (relies on .dockerignore to filter)
15+ COPY . .
1816
1917# Build
2018# the GOARCH has no default value to allow the binary to be built according to the host where the command
Original file line number Diff line number Diff line change 11# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2- # Ignore build and test binaries.
3- bin /
2+ # Ignore everything by default and re-include only needed files
3+ **
4+
5+ # Re-include Go source files (but not *_test.go)
6+ ! ** /* .go
7+ ** /* _test.go
8+
9+ # Re-include Go module files
10+ ! go.mod
11+ ! go.sum
Original file line number Diff line number Diff line change @@ -11,10 +11,8 @@ COPY go.sum go.sum
1111# and so that source changes don't invalidate our downloaded layer
1212RUN go mod download
1313
14- # Copy the go source
15- COPY cmd/main.go cmd/main.go
16- COPY api/ api/
17- COPY internal/ internal/
14+ # Copy the Go source (relies on .dockerignore to filter)
15+ COPY . .
1816
1917# Build
2018# the GOARCH has no default value to allow the binary to be built according to the host where the command
Original file line number Diff line number Diff line change @@ -51,10 +51,8 @@ COPY go.sum go.sum
5151# and so that source changes don't invalidate our downloaded layer
5252RUN go mod download
5353
54- # Copy the go source
55- COPY cmd/main.go cmd/main.go
56- COPY api/ api/
57- COPY internal/ internal/
54+ # Copy the Go source (relies on .dockerignore to filter)
55+ COPY . .
5856
5957# Build
6058# the GOARCH has no default value to allow the binary to be built according to the host where the command
Original file line number Diff line number Diff line change @@ -39,6 +39,14 @@ func (f *DockerIgnore) SetTemplateDefaults() error {
3939}
4040
4141const dockerignorefileTemplate = `# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
42- # Ignore build and test binaries.
43- bin/
42+ # Ignore everything by default and re-include only needed files
43+ **
44+
45+ # Re-include Go source files (but not *_test.go)
46+ !**/*.go
47+ **/*_test.go
48+
49+ # Re-include Go module files
50+ !go.mod
51+ !go.sum
4452`
Original file line number Diff line number Diff line change 11# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2- # Ignore build and test binaries.
3- bin /
2+ # Ignore everything by default and re-include only needed files
3+ **
4+
5+ # Re-include Go source files (but not *_test.go)
6+ ! ** /* .go
7+ ** /* _test.go
8+
9+ # Re-include Go module files
10+ ! go.mod
11+ ! go.sum
Original file line number Diff line number Diff line change @@ -11,10 +11,8 @@ COPY go.sum go.sum
1111# and so that source changes don't invalidate our downloaded layer
1212RUN go mod download
1313
14- # Copy the go source
15- COPY cmd/main.go cmd/main.go
16- COPY api/ api/
17- COPY internal/ internal/
14+ # Copy the Go source (relies on .dockerignore to filter)
15+ COPY . .
1816
1917# Build
2018# the GOARCH has no default value to allow the binary to be built according to the host where the command
You can’t perform that action at this time.
0 commit comments