# This dockerfile is specific to building Multus for OpenShift
FROM openshift/golang-builder@sha256:2c34135dc4d4a35fa19775e4e559e2e6f2e476a0ccdc993360e3663729904035 AS build
ENV __doozer=update BUILD_RELEASE=202201261125.p0.gfd12fed.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202201261125.p0.gfd12fed.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=fd12fed OS_GIT_VERSION=4.9.0-202201261125.p0.gfd12fed.assembly.stream-fd12fed SOURCE_DATE_EPOCH=1625803597 SOURCE_GIT_COMMIT=fd12fedeb9e05637279386aa2aacd443ac1c0da7 SOURCE_GIT_TAG=fd12fed SOURCE_GIT_URL=https://github.com/openshift/multus-networkpolicy 

# Add everything
ADD . /usr/src/multi-networkpolicy-iptables
WORKDIR /usr/src/multi-networkpolicy-iptables
RUN go build ./cmd/multi-networkpolicy-iptables/

FROM openshift/ose-base:v4.9.0.20220126.115034
ENV __doozer=update BUILD_RELEASE=202201261125.p0.gfd12fed.assembly.stream BUILD_VERSION=v4.9.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=9 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.9.0-202201261125.p0.gfd12fed.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=fd12fed OS_GIT_VERSION=4.9.0-202201261125.p0.gfd12fed.assembly.stream-fd12fed SOURCE_DATE_EPOCH=1625803597 SOURCE_GIT_COMMIT=fd12fedeb9e05637279386aa2aacd443ac1c0da7 SOURCE_GIT_TAG=fd12fed SOURCE_GIT_URL=https://github.com/openshift/multus-networkpolicy 
RUN dnf install -y iptables
COPY --from=build /usr/src/multi-networkpolicy-iptables/multi-networkpolicy-iptables /usr/bin
WORKDIR /usr/bin


ENTRYPOINT ["multi-networkpolicy-iptables"]

LABEL \
        io.k8s.display-name="Multus NetworkPolicy" \
        io.k8s.description="This is a component of OpenShift Container Platform and provides NetworkPolicy objects for secondary interfaces created with Multus CNI" \
        io.openshift.tags="openshift" \
        maintainer="Doug Smith <dosmith@redhat.com>" \
        name="openshift/ose-multus-networkpolicy" \
        com.redhat.component="ose-multus-networkpolicy-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Networking" \
        io.openshift.maintainer.subcomponent="multus" \
        release="202201261125.p0.gfd12fed.assembly.stream" \
        io.openshift.build.commit.id="fd12fedeb9e05637279386aa2aacd443ac1c0da7" \
        io.openshift.build.source-location="https://github.com/openshift/multus-networkpolicy" \
        io.openshift.build.commit.url="https://github.com/openshift/multus-networkpolicy/commit/fd12fedeb9e05637279386aa2aacd443ac1c0da7" \
        version="v4.9.0"

