FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202109092011.p0.git.48d0fb3.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-202109092011.p0.git.48d0fb3.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=48d0fb3a138e1e831aaa29123b271d75a137d693 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=13+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.13.0+48d0fb3 OS_GIT_COMMIT=48d0fb3 OS_GIT_VERSION=4.7.0-202109092011.p0.git.48d0fb3.assembly.stream-48d0fb3 SOURCE_DATE_EPOCH=1631132843 SOURCE_GIT_COMMIT=48d0fb3a138e1e831aaa29123b271d75a137d693 SOURCE_GIT_TAG=v0.17.0-144-g48d0fb3a 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.20210909.202007
ENV __doozer=update BUILD_RELEASE=202109092011.p0.git.48d0fb3.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-202109092011.p0.git.48d0fb3.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=48d0fb3a138e1e831aaa29123b271d75a137d693 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=13+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.13.0+48d0fb3 OS_GIT_COMMIT=48d0fb3 OS_GIT_VERSION=4.7.0-202109092011.p0.git.48d0fb3.assembly.stream-48d0fb3 SOURCE_DATE_EPOCH=1631132843 SOURCE_GIT_COMMIT=48d0fb3a138e1e831aaa29123b271d75a137d693 SOURCE_GIT_TAG=v0.17.0-144-g48d0fb3a SOURCE_GIT_URL=https://github.com/openshift/kubernetes-nmstate 

COPY --from=builder /go/src/github.com/openshift/kubernetes-nmstate/build/_output/bin/manager /usr/bin/
COPY deploy/crds/nmstate.io_nodenetwork*.yaml /bindata/kubernetes-nmstate/crds/
COPY deploy/handler/namespace.yaml /bindata/kubernetes-nmstate/namespace/
COPY deploy/handler/operator.yaml /bindata/kubernetes-nmstate/handler/handler.yaml
COPY deploy/handler/service_account.yaml /bindata/kubernetes-nmstate/rbac/
COPY deploy/handler/role.yaml /bindata/kubernetes-nmstate/rbac/
COPY deploy/handler/role_binding.yaml /bindata/kubernetes-nmstate/rbac/
COPY --from=builder /go/src/github.com/openshift/kubernetes-nmstate/manifests /manifests
COPY --from=builder /go/src/github.com/openshift/kubernetes-nmstate/metadata /metadata

ENTRYPOINT ["manager"]

LABEL \
        io.k8s.display-name="kubernetes-nmstate-operator" \
        io.k8s.description="Operator for Node network configuration through Kubernetes API" \
        io.openshift.tags="openshift,kubernetes-nmstate-operator" \
        com.redhat.delivery.appregistry="False" \
        maintainer="Yossi Boaron <yboaron@redhat.com>" \
        name="openshift/kubernetes-nmstate-rhel8-operator" \
        com.redhat.component="ose-kubernetes-nmstate-operator-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Networking" \
        io.openshift.maintainer.subcomponent="kubernetes-nmstate-operator,kubernetes-nmstate" \
        release="202109092011.p0.git.48d0fb3.assembly.stream" \
        io.openshift.build.commit.id="48d0fb3a138e1e831aaa29123b271d75a137d693" \
        io.openshift.build.source-location="https://github.com/openshift/kubernetes-nmstate" \
        io.openshift.build.commit.url="https://github.com/openshift/kubernetes-nmstate/commit/48d0fb3a138e1e831aaa29123b271d75a137d693" \
        version="v4.7.0"

