FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202109281038.p0.git.32d8043.assembly.stream BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202109281038.p0.git.32d8043.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=32d804364c4d622a996af656b42b4992c49bf65a KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=13+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.13.0+32d8043 OS_GIT_COMMIT=32d8043 OS_GIT_VERSION=4.6.0-202109281038.p0.git.32d8043.assembly.stream-32d8043 SOURCE_DATE_EPOCH=1632823394 SOURCE_GIT_COMMIT=32d804364c4d622a996af656b42b4992c49bf65a SOURCE_GIT_TAG=32d80436 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-baremetal 
WORKDIR /go/src/github.com/openshift/cluster-api-provider-baremetal
COPY . .
RUN go build --mod=vendor -o machine-controller-manager ./cmd/manager

FROM openshift/ose-base:v4.6.0-202109030220.p0.git.618b71d.assembly.stream
ENV __doozer=update BUILD_RELEASE=202109281038.p0.git.32d8043.assembly.stream BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202109281038.p0.git.32d8043.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=32d804364c4d622a996af656b42b4992c49bf65a KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=13+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.13.0+32d8043 OS_GIT_COMMIT=32d8043 OS_GIT_VERSION=4.6.0-202109281038.p0.git.32d8043.assembly.stream-32d8043 SOURCE_DATE_EPOCH=1632823394 SOURCE_GIT_COMMIT=32d804364c4d622a996af656b42b4992c49bf65a SOURCE_GIT_TAG=32d80436 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-baremetal 
#RUN INSTALL_PKGS=" \
#      libvirt-libs openssh-clients genisoimage \
#      " && \
#    yum install -y $INSTALL_PKGS && \
#    rpm -V $INSTALL_PKGS && \
#    yum clean all
COPY --from=builder /go/src/github.com/openshift/cluster-api-provider-baremetal/machine-controller-manager /

LABEL \
        name="openshift/ose-baremetal-machine-controllers" \
        com.redhat.component="baremetal-machine-controller-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Bare Metal Hardware Provisioning" \
        io.openshift.maintainer.subcomponent="cluster-api-provider" \
        release="202109281038.p0.git.32d8043.assembly.stream" \
        io.openshift.build.commit.id="32d804364c4d622a996af656b42b4992c49bf65a" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-api-provider-baremetal" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-api-provider-baremetal/commit/32d804364c4d622a996af656b42b4992c49bf65a" \
        version="v4.6.0"

