Skip to content

Commit

Permalink
Adjust Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuckal777 committed Apr 6, 2022
1 parent 1c553f0 commit 0b0e440
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
./e2e
./testbin
./.vscode
./bin
17 changes: 2 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.18 as builder
FROM golang:1.18-alpine as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -9,20 +9,7 @@ COPY go.sum go.sum
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

# Copy the go source
COPY main.go main.go
# COPY api/ api/
COPY controllers/ controllers/
COPY plugin/ plugin/
COPY state/ state/
COPY esx/ esx/
COPY event/ event/
COPY constants/ constants/
COPY kubernikus/ kubernikus/
COPY common/ common/
COPY metrics/ metrics/

# Build
COPY ./ /workspace/
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go

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

0 comments on commit 0b0e440

Please sign in to comment.