FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202103010125.p0 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-202103010125.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=11db4d1a06ba84693975d9ccd99e70a8dc04cfd7 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=13+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.13.0+11db4d1 OS_GIT_COMMIT=11db4d1 OS_GIT_VERSION=4.7.0-202103010125.p0-11db4d1 SOURCE_DATE_EPOCH=1612272058 SOURCE_GIT_COMMIT=11db4d1a06ba84693975d9ccd99e70a8dc04cfd7 SOURCE_GIT_TAG=v0.17.0-140-g11db4d1a SOURCE_GIT_URL=https://github.com/openshift/kubernetes-nmstate 
WORKDIR /go/src/github.com/openshift/kubernetes-nmstate
COPY . .
RUN GO111MODULE=on go build --mod=vendor -o build/_output/bin/manager main.go

FROM openshift/ose-base:v4.7.0.20210301.020426
ENV __doozer=update BUILD_RELEASE=202103010125.p0 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-202103010125.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=11db4d1a06ba84693975d9ccd99e70a8dc04cfd7 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=13+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.13.0+11db4d1 OS_GIT_COMMIT=11db4d1 OS_GIT_VERSION=4.7.0-202103010125.p0-11db4d1 SOURCE_DATE_EPOCH=1612272058 SOURCE_GIT_COMMIT=11db4d1a06ba84693975d9ccd99e70a8dc04cfd7 SOURCE_GIT_TAG=v0.17.0-140-g11db4d1a SOURCE_GIT_URL=https://github.com/openshift/kubernetes-nmstate 

RUN \
    yum -y update && \
    yum -y install \
        nmstate \
        iputils \
        iproute && \
    yum clean all


COPY --from=builder /go/src/github.com/openshift/kubernetes-nmstate/build/_output/bin/manager  /usr/bin/
COPY --from=builder /go/src/github.com/openshift/kubernetes-nmstate/build/bin   /usr/bin/

ENTRYPOINT ["/usr/bin/manager"]

LABEL \
        io.k8s.display-name="kubernetes-nmstate-handler" \
        io.k8s.description="Configure node networking through Kubernetes API" \
        maintainer="Yossi Boaron <yboaron@redhat.com>" \
        name="openshift/ose-kubernetes-nmstate-handler-rhel8" \
        com.redhat.component="openshift-kubernetes-nmstate-handler-rhel-8-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Networking" \
        io.openshift.maintainer.subcomponent="kubernetes-nmstate-operator,kubernetes-nmstate" \
        release="202103010125.p0" \
        io.openshift.build.commit.id="11db4d1a06ba84693975d9ccd99e70a8dc04cfd7" \
        io.openshift.build.source-location="https://github.com/openshift/kubernetes-nmstate" \
        io.openshift.build.commit.url="https://github.com/openshift/kubernetes-nmstate/commit/11db4d1a06ba84693975d9ccd99e70a8dc04cfd7" \
        version="v4.7.0"

