FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202011261617.p0 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-202011261617.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=fcd9e769a45cc54b4d13959b2253fefc2e1d76d4 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=13+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.13.0+fcd9e76 OS_GIT_COMMIT=fcd9e76 OS_GIT_VERSION=4.6.0-202011261617.p0-fcd9e76 SOURCE_DATE_EPOCH=1604546634 SOURCE_GIT_COMMIT=fcd9e769a45cc54b4d13959b2253fefc2e1d76d4 SOURCE_GIT_TAG=fcd9e769 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.20201126.164052
ENV __doozer=update BUILD_RELEASE=202011261617.p0 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-202011261617.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=fcd9e769a45cc54b4d13959b2253fefc2e1d76d4 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=13+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.13.0+fcd9e76 OS_GIT_COMMIT=fcd9e76 OS_GIT_VERSION=4.6.0-202011261617.p0-fcd9e76 SOURCE_DATE_EPOCH=1604546634 SOURCE_GIT_COMMIT=fcd9e769a45cc54b4d13959b2253fefc2e1d76d4 SOURCE_GIT_TAG=fcd9e769 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="202011261617.p0" \
        io.openshift.build.commit.id="fcd9e769a45cc54b4d13959b2253fefc2e1d76d4" \
        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/fcd9e769a45cc54b4d13959b2253fefc2e1d76d4" \
        version="v4.6.0"

