Skip to content

Commit 07ff611

Browse files
committed
♻️ Revert Dockerfile changes, keep only Makefile improvements
Based on maintainer feedback, reverting the Dockerfile and .dockerignore changes to focus solely on the Makefile install/uninstall improvements. The Dockerfile issue will be addressed separately with a dynamic approach where COPY directives are added incrementally as components are created. This commit: - Reverts Dockerfile to original state with specific COPY directives - Reverts .dockerignore to minimal configuration - Keeps the improved Makefile install/uninstall targets that handle empty CRD directories - Updates all samples and testdata with the reverted templates
1 parent 7644cf6 commit 07ff611

File tree

14 files changed

+28
-133
lines changed

14 files changed

+28
-133
lines changed
Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
11
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2-
# VCS & tooling
3-
.git
4-
.github
5-
.DS_Store
6-
7-
# Build artifacts
2+
# Ignore build and test binaries.
83
bin/
9-
dist/
10-
11-
# Utilities
12-
hack/
13-
14-
# Go junk you don't want in the image
15-
**/*_test.go
16-
coverage.*
17-
*.log
18-
19-
# If you use vendor, remove this ignore or whitelist it instead
20-
vendor/

docs/book/src/cronjob-tutorial/testdata/project/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ COPY go.sum go.sum
1212
RUN go mod download
1313

1414
# Copy the go source
15-
COPY . .
15+
COPY cmd/main.go cmd/main.go
16+
COPY api/ api/
17+
COPY internal/ internal/
1618

1719
# Build
1820
# the GOARCH has not a default value to allow the binary be built according to the host where the command
Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
11
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2-
# VCS & tooling
3-
.git
4-
.github
5-
.DS_Store
6-
7-
# Build artifacts
2+
# Ignore build and test binaries.
83
bin/
9-
dist/
10-
11-
# Utilities
12-
hack/
13-
14-
# Go junk you don't want in the image
15-
**/*_test.go
16-
coverage.*
17-
*.log
18-
19-
# If you use vendor, remove this ignore or whitelist it instead
20-
vendor/

docs/book/src/getting-started/testdata/project/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ COPY go.sum go.sum
1212
RUN go mod download
1313

1414
# Copy the go source
15-
COPY . .
15+
COPY cmd/main.go cmd/main.go
16+
COPY api/ api/
17+
COPY internal/ internal/
1618

1719
# Build
1820
# the GOARCH has not a default value to allow the binary be built according to the host where the command
Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
11
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2-
# VCS & tooling
3-
.git
4-
.github
5-
.DS_Store
6-
7-
# Build artifacts
2+
# Ignore build and test binaries.
83
bin/
9-
dist/
10-
11-
# Utilities
12-
hack/
13-
14-
# Go junk you don't want in the image
15-
**/*_test.go
16-
coverage.*
17-
*.log
18-
19-
# If you use vendor, remove this ignore or whitelist it instead
20-
vendor/

docs/book/src/multiversion-tutorial/testdata/project/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ COPY go.sum go.sum
1212
RUN go mod download
1313

1414
# Copy the go source
15-
COPY . .
15+
COPY cmd/main.go cmd/main.go
16+
COPY api/ api/
17+
COPY internal/ internal/
1618

1719
# Build
1820
# the GOARCH has not a default value to allow the binary be built according to the host where the command

pkg/plugins/golang/v4/scaffolds/internal/templates/dockerfile.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ COPY go.sum go.sum
5353
RUN go mod download
5454
5555
# Copy the go source
56-
COPY . .
56+
COPY cmd/main.go cmd/main.go
57+
COPY api/ api/
58+
COPY internal/ internal/
5759
5860
# Build
5961
# the GOARCH has not a default value to allow the binary be built according to the host where the command

pkg/plugins/golang/v4/scaffolds/internal/templates/dockerignore.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,6 @@ func (f *DockerIgnore) SetTemplateDefaults() error {
3939
}
4040

4141
const dockerignorefileTemplate = `# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
42-
# VCS & tooling
43-
.git
44-
.github
45-
.DS_Store
46-
47-
# Build artifacts
42+
# Ignore build and test binaries.
4843
bin/
49-
dist/
50-
51-
# Utilities
52-
hack/
53-
54-
# Go junk you don't want in the image
55-
**/*_test.go
56-
coverage.*
57-
*.log
58-
59-
# If you use vendor, remove this ignore or whitelist it instead
60-
vendor/
6144
`
Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
11
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2-
# VCS & tooling
3-
.git
4-
.github
5-
.DS_Store
6-
7-
# Build artifacts
2+
# Ignore build and test binaries.
83
bin/
9-
dist/
10-
11-
# Utilities
12-
hack/
13-
14-
# Go junk you don't want in the image
15-
**/*_test.go
16-
coverage.*
17-
*.log
18-
19-
# If you use vendor, remove this ignore or whitelist it instead
20-
vendor/

testdata/project-v4-multigroup/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ COPY go.sum go.sum
1212
RUN go mod download
1313

1414
# Copy the go source
15-
COPY . .
15+
COPY cmd/main.go cmd/main.go
16+
COPY api/ api/
17+
COPY internal/ internal/
1618

1719
# Build
1820
# the GOARCH has not a default value to allow the binary be built according to the host where the command

0 commit comments

Comments
 (0)