-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (20 loc) · 878 Bytes
/
Dockerfile
File metadata and controls
25 lines (20 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Build the manager binary
FROM golang:1.25.5 as builder
WORKDIR /go/src/github.com/gardener/kupid
# Copy the Go Modules manifests
COPY go.mod /go/src/github.com/gardener/kupid/go.mod
COPY go.sum /go/src/github.com/gardener/kupid/go.sum
# Copy the go source
COPY main.go /go/src/github.com/gardener/kupid/main.go
COPY api/ /go/src/github.com/gardener/kupid/api/
COPY pkg/ /go/src/github.com/gardener/kupid/pkg/
COPY vendor/ /go/src/github.com/gardener/kupid/vendor/
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -v -mod=vendor -o kupid main.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /go/src/github.com/gardener/kupid/kupid .
USER nonroot:nonroot
ENTRYPOINT ["/kupid"]