forked from openshift/sandboxed-containers-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (43 loc) · 1.92 KB
/
Dockerfile
File metadata and controls
54 lines (43 loc) · 1.92 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM registry.access.redhat.com/ubi9/go-toolset:1.25.5-1770654497 as builder
# Required by the ubi based go-toolset image
USER root
WORKDIR /workspace
COPY Makefile Makefile
COPY hack hack/
COPY PROJECT PROJECT
COPY go.mod go.mod
COPY go.sum go.sum
COPY cmd/ cmd/
COPY api api/
COPY config config/
COPY controllers controllers/
# Copy our controller-gen script to work around hermetic build issues
# See comments in the script itself for more details.
COPY controller-gen bin/
# get the version of controller-gen in an env variable for reusing
RUN echo "export CONTROLLER_TOOLS_VERSION=$(grep -m 1 controller-tools go.mod | awk '{print $2}')" > controller-tools-ver
# rename the script to use the same version as defined in our go.mod file
RUN . ./controller-tools-ver && mv bin/controller-gen bin/controller-gen-$CONTROLLER_TOOLS_VERSION
# make sure 'make' uses the right version of controller-gen
RUN . ./controller-tools-ver && make build
# Use OpenShift base image
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7-1770267347
WORKDIR /
COPY --from=builder /workspace/bin/manager .
COPY --from=builder /workspace/bin/metrics-server .
COPY --from=builder /workspace/config/peerpods /config/peerpods
RUN useradd -r -u 499 nonroot
RUN getent group nonroot || groupadd -o -g 499 nonroot
# Red Hat labels
LABEL name="openshift-sandboxed-containers/osc-rhel9-operator" \
cpe="cpe:/a:redhat:confidential_compute_attestation:1.11::el9" \
version="1.11" \
com.redhat.component="osc-operator-container" \
summary="This operator manages the Openshift Sandboxed Containers runtime installation" \
maintainer="redhat@redhat.com" \
description="The Openshift Sandboxed containers operator manages runtime configuration and lifecycle" \
io.k8s.display-name="openshift-sandboxed-containers-operator" \
io.k8s.description="This operator manages the Openshift Sandboxed Containers runtime installation" \
io.openshift.tags=""
USER 499:499
ENTRYPOINT ["/manager"]