# This dockerfile is specific to building Multus for OpenShift
FROM openshift/golang-builder:1.11 AS builder
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=23 OS_GIT_VERSION=4.2.23-202003090920-b5e1059 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=b5e1059a79397ef886a8047cb4c61919c787f5f5 SOURCE_GIT_TAG=b5e1059 SOURCE_GIT_URL=https://github.com/openshift/containernetworking-plugins SOURCE_DATE_EPOCH=1569282616 OS_GIT_COMMIT=b5e1059 BUILD_VERSION=v4.2.23 BUILD_RELEASE=202003090920

# Add everything
ADD . /usr/src/plugins

WORKDIR /usr/src/plugins
ENV CGO_ENABLED=0
RUN ./build_linux.sh && \
    cd /usr/src/plugins/bin

WORKDIR /

FROM openshift/ose-base:v4.2.23.20200309.092017
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=23 OS_GIT_VERSION=4.2.23-202003090920-b5e1059 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=b5e1059a79397ef886a8047cb4c61919c787f5f5 SOURCE_GIT_TAG=b5e1059 SOURCE_GIT_URL=https://github.com/openshift/containernetworking-plugins SOURCE_DATE_EPOCH=1569282616 OS_GIT_COMMIT=b5e1059 BUILD_VERSION=v4.2.23 BUILD_RELEASE=202003090920
RUN mkdir -p /usr/src/plugins/bin
COPY --from=builder /usr/src/plugins/bin/* /usr/src/plugins/bin/

LABEL \
        io.k8s.display-name="Container Networking Plugins" \
        io.k8s.description="This is a component of OpenShift Container Platform and provides the reference CNI plugins." \
        io.openshift.tags="openshift" \
        maintainer="Doug Smith <dosmith@redhat.com>" \
        name="openshift/ose-container-networking-plugins" \
        com.redhat.component="ose-containernetworking-plugins-container" \
        version="v4.2.23" \
        release="202003090920" \
        io.openshift.build.commit.id="b5e1059a79397ef886a8047cb4c61919c787f5f5" \
        io.openshift.build.source-location="https://github.com/openshift/containernetworking-plugins" \
        io.openshift.build.commit.url="https://github.com/openshift/containernetworking-plugins/commit/b5e1059a79397ef886a8047cb4c61919c787f5f5"

