# This dockerfile is specific to building Multus for OpenShift
FROM openshift/golang-builder@sha256:ab1bfcb9d06b339cb767acb804e6aa82eb23cd0795e6f82af54e92c312a32777 AS rhel8
ENV __doozer=update BUILD_RELEASE=202201211922.p0.g5530094.assembly.stream BUILD_VERSION=v4.7.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=7 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.7.0-202201211922.p0.g5530094.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=5530094 OS_GIT_VERSION=4.7.0-202201211922.p0.g5530094.assembly.stream-5530094 SOURCE_DATE_EPOCH=1618084818 SOURCE_GIT_COMMIT=5530094db7607fc9292e3b269fcf5a85b0dad3df SOURCE_GIT_TAG=5530094d SOURCE_GIT_URL=https://github.com/openshift/multus-cni 
ADD . /usr/src/multus-cni
WORKDIR /usr/src/multus-cni
ENV CGO_ENABLED=1
ENV GO111MODULE=off
ENV VERSION=rhel8 COMMIT=unset
RUN ./build && \
       cd /usr/src/multus-cni/bin
WORKDIR /

FROM openshift/golang-builder@sha256:a777e42f935d9f822f37601fe674c0a9dc4e54234ffc3f02a70b7fc5e0d6c88f AS rhel7
ENV __doozer=update BUILD_RELEASE=202201211922.p0.g5530094.assembly.stream BUILD_VERSION=v4.7.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=7 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.7.0-202201211922.p0.g5530094.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=5530094 OS_GIT_VERSION=4.7.0-202201211922.p0.g5530094.assembly.stream-5530094 SOURCE_DATE_EPOCH=1618084818 SOURCE_GIT_COMMIT=5530094db7607fc9292e3b269fcf5a85b0dad3df SOURCE_GIT_TAG=5530094d SOURCE_GIT_URL=https://github.com/openshift/multus-cni 
ADD . /usr/src/multus-cni
WORKDIR /usr/src/multus-cni
ENV CGO_ENABLED=1
ENV GO111MODULE=off
RUN ./build && \
       cd /usr/src/multus-cni/bin

WORKDIR /usr/src/multus-cni
ENV GO111MODULE=off
RUN ./build && \
       cd /usr/src/multus-cni/bin
WORKDIR /

FROM openshift/ose-base:v4.7.0-202201082234.p0.g0e45f63.assembly.stream
ENV __doozer=update BUILD_RELEASE=202201211922.p0.g5530094.assembly.stream BUILD_VERSION=v4.7.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=7 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.7.0-202201211922.p0.g5530094.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=5530094 OS_GIT_VERSION=4.7.0-202201211922.p0.g5530094.assembly.stream-5530094 SOURCE_DATE_EPOCH=1618084818 SOURCE_GIT_COMMIT=5530094db7607fc9292e3b269fcf5a85b0dad3df SOURCE_GIT_TAG=5530094d SOURCE_GIT_URL=https://github.com/openshift/multus-cni 
RUN mkdir -p /usr/src/multus-cni/images && \
       mkdir -p /usr/src/multus-cni/bin && \
       mkdir -p /usr/src/multus-cni/rhel7/bin && \
       mkdir -p /usr/src/multus-cni/rhel8/bin
COPY --from=rhel7 /usr/src/multus-cni/bin/multus /usr/src/multus-cni/rhel7/bin
COPY --from=rhel8 /usr/src/multus-cni/bin/multus /usr/src/multus-cni/bin
COPY --from=rhel8 /usr/src/multus-cni/bin/multus /usr/src/multus-cni/rhel8/bin
ADD ./images/entrypoint.sh /


ENTRYPOINT ["/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 <dosmith@redhat.com>" \
        vendor="Red Hat" \
        name="openshift/ose-multus-cni" \
        com.redhat.component="multus-cni-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Networking" \
        io.openshift.maintainer.subcomponent="multus" \
        release="202201211922.p0.g5530094.assembly.stream" \
        io.openshift.build.commit.id="5530094db7607fc9292e3b269fcf5a85b0dad3df" \
        io.openshift.build.source-location="https://github.com/openshift/multus-cni" \
        io.openshift.build.commit.url="https://github.com/openshift/multus-cni/commit/5530094db7607fc9292e3b269fcf5a85b0dad3df" \
        version="v4.7.0"

