forked from CoHDI/dynamic-device-scaler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (18 loc) · 659 Bytes
/
Dockerfile
File metadata and controls
23 lines (18 loc) · 659 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
ARG BUILD_IMAGE=docker.io/golang:1.24
ARG BASE_IMAGE=gcr.io/distroless/static:nonroot
# Build the manager binary
FROM $BUILD_IMAGE AS builder
WORKDIR /workspace
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
COPY cmd/main.go cmd/main.go
COPY internal/ internal/
RUN CGO_ENABLED=0 GO111MODULE=on go build -a -o dynamic-device-scaler cmd/main.go
# Copy the controller-manager into a thin image
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM $BASE_IMAGE
WORKDIR /
COPY --from=builder /workspace/dynamic-device-scaler .
USER nonroot:nonroot