forked from kubernetes-sigs/node-feature-discovery-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (28 loc) · 998 Bytes
/
Dockerfile
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
26
27
28
29
30
31
32
33
34
35
36
37
ARG BUILDER_IMAGE
ARG BASE_IMAGE_DEBUG
ARG BASE_IMAGE_PROD
# Build the manager biinary
FROM ${BUILDER_IMAGE} as builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod 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
# Build
COPY . .
RUN make build
# Debug image for running the operator
FROM ${BASE_IMAGE_DEBUG} as debug
COPY --from=builder /workspace/node-feature-discovery-operator /
# Run as unprivileged user
USER 65534:65534
ENTRYPOINT ["/node-feature-discovery-operator"]
LABEL io.k8s.display-name="node-feature-discovery-operator"
# Production image for running the operator
FROM ${BASE_IMAGE_PROD} as prod
COPY --from=builder /workspace/node-feature-discovery-operator /
# Run as unprivileged user
USER 65534:65534
ENTRYPOINT ["/node-feature-discovery-operator"]
LABEL io.k8s.display-name="node-feature-discovery-operator"