-
Notifications
You must be signed in to change notification settings - Fork 50
/
Dockerfile.openshift
40 lines (36 loc) · 1.53 KB
/
Dockerfile.openshift
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
# This dockerfile is specific to building Multus for OpenShift
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS rhel9
ADD . /usr/src/multus-cni
WORKDIR /usr/src/multus-cni
ENV CGO_ENABLED=1
ENV GO111MODULE=off
ENV VERSION=rhel9 COMMIT=unset
RUN ./hack/build-go.sh && \
cd /usr/src/multus-cni/bin
WORKDIR /
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS rhel8
ADD . /usr/src/multus-cni
WORKDIR /usr/src/multus-cni
ENV CGO_ENABLED=1
ENV GO111MODULE=off
ENV VERSION=rhel8 COMMIT=unset
RUN ./hack/build-go.sh && \
cd /usr/src/multus-cni/bin
WORKDIR /
FROM registry.ci.openshift.org/ocp/4.16:base-rhel9
RUN dnf install -y util-linux && dnf clean all && \
mkdir -p /usr/src/multus-cni/images && \
mkdir -p /usr/src/multus-cni/bin && \
mkdir -p /usr/src/multus-cni/rhel9/bin && \
mkdir -p /usr/src/multus-cni/rhel8/bin
COPY --from=rhel9 /usr/src/multus-cni/bin /usr/src/multus-cni/rhel9/bin
COPY --from=rhel8 /usr/src/multus-cni/bin /usr/src/multus-cni/rhel8/bin
# copy container base image binary to /usr/src/multus-cni/bin
RUN bash -c '. /etc/os-release; \
cp /usr/src/multus-cni/rhel$(echo "${VERSION_ID}" | cut -f 1 -d .)/bin/* /usr/src/multus-cni/bin'
ADD ./images/entrypoint.sh /
LABEL io.k8s.display-name="Multus CNI" \
io.k8s.description="This is a component of OpenShift Container Platform and provides a meta CNI plugin." \
io.openshift.tags="openshift" \
maintainer="Doug Smith <[email protected]>"
ENTRYPOINT ["/entrypoint.sh"]