FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202107070458.p0.git.3a0d90c.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-202107070458.p0.git.3a0d90c.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=3a0d90c OS_GIT_VERSION=4.7.0-202107070458.p0.git.3a0d90c.assembly.stream-3a0d90c SOURCE_DATE_EPOCH=1619633627 SOURCE_GIT_COMMIT=3a0d90c3760502eec2732a7b4222d972c940e854 SOURCE_GIT_TAG=3a0d90c SOURCE_GIT_URL=https://github.com/openshift/ib-sriov-cni 

COPY . /usr/src/ib-sriov-cni

WORKDIR /usr/src/ib-sriov-cni
RUN make clean && \
    make build

FROM openshift/ose-base:v4.7.0.20210707.052006
ENV __doozer=update BUILD_RELEASE=202107070458.p0.git.3a0d90c.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-202107070458.p0.git.3a0d90c.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=3a0d90c OS_GIT_VERSION=4.7.0-202107070458.p0.git.3a0d90c.assembly.stream-3a0d90c SOURCE_DATE_EPOCH=1619633627 SOURCE_GIT_COMMIT=3a0d90c3760502eec2732a7b4222d972c940e854 SOURCE_GIT_TAG=3a0d90c SOURCE_GIT_URL=https://github.com/openshift/ib-sriov-cni 
COPY --from=builder /usr/src/ib-sriov-cni/build/ib-sriov /usr/bin/
WORKDIR /


COPY ./images/entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh"]

LABEL \
        io.k8s.display-name="InfiniBand SR-IOV CNI" \
        name="openshift/ose-sriov-infiniband-cni" \
        com.redhat.component="ib-sriov-cni-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Networking" \
        io.openshift.maintainer.subcomponent="SR-IOV" \
        release="202107070458.p0.git.3a0d90c.assembly.stream" \
        io.openshift.build.commit.id="3a0d90c3760502eec2732a7b4222d972c940e854" \
        io.openshift.build.source-location="https://github.com/openshift/ib-sriov-cni" \
        io.openshift.build.commit.url="https://github.com/openshift/ib-sriov-cni/commit/3a0d90c3760502eec2732a7b4222d972c940e854" \
        version="v4.7.0"

