Skip to content

Commit a2e35c9

Browse files
author
Ben Du
authored
Fix make docker-build command (#3)
1 parent 2d9631f commit a2e35c9

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Dockerfile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
# Build the manager binary
2-
FROM golang:1.15 as builder
2+
FROM golang:1.17 as builder
33

44
WORKDIR /workspace
5-
# Copy the Go Modules manifests
6-
COPY go.mod go.mod
7-
COPY go.sum go.sum
5+
6+
# Copy the Go Modules manifests, plus the source
7+
COPY . ./
8+
89
# cache deps before building and copying source so that we don't need to re-download as much
910
# and so that source changes don't invalidate our downloaded layer
1011
RUN go mod download
1112

12-
# Copy the go source
13-
COPY main.go main.go
14-
COPY pkg/api api/
15-
COPY pkg/controllers controllers/
16-
1713
# Build
1814
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
1915

0 commit comments

Comments
 (0)