forked from kubernetes-sigs/node-feature-discovery-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (28 loc) · 1.06 KB
/
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
ARG BUILDER_IMAGE
ARG BASE_IMAGE_FULL
ARG BASE_IMAGE_MINIMAL
# 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
# Create production image for running the operator
FROM ${BASE_IMAGE_FULL} as full
COPY --from=builder /workspace/node-feature-discovery-operator /
COPY --from=builder /workspace/build/assets /opt/nfd
# Run as unprivileged user
USER 65534:65534
ENTRYPOINT ["/node-feature-discovery-operator"]
LABEL io.k8s.display-name="node-feature-discovery-operator"
# Create a minimal image for running the operator
FROM ${BASE_IMAGE_MINIMAL} as minimal
COPY --from=builder /workspace/node-feature-discovery-operator /
COPY --from=builder /workspace/build/assets /opt/nfd
ENTRYPOINT ["/node-feature-discovery-operator"]
LABEL io.k8s.display-name="node-feature-discovery-operator"