Skip to content

Commit

Permalink
Fix: Dockerfile: Fixing dockerfile for usage go get and remove go gen…
Browse files Browse the repository at this point in the history
…erate
  • Loading branch information
wiliansilvazup committed Sep 16, 2021
1 parent 689748a commit 61bcf94
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions deployments/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,10 @@ FROM golang:1.17 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

# Copy the go source
COPY api/ api/
COPY cmd/ cmd/
COPY controllers/ controllers/
COPY internal/ internal/
COPY . .

# Build
RUN go generate ./...
RUN go get -t -v -d ./...
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager ./cmd/app

# Use distroless as minimal base image to package the manager binary
Expand Down

0 comments on commit 61bcf94

Please sign in to comment.