FROM openshift/golang-builder:1.13 AS builder
ENV __doozer=update BUILD_RELEASE=202007281519.p0 BUILD_VERSION=v4.5.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=5 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.5.0-202007281519.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=bd625d4 OS_GIT_VERSION=4.5.0-202007281519.p0-bd625d4 SOURCE_DATE_EPOCH=1590776927 SOURCE_GIT_COMMIT=bd625d43c6261fc47fd3c9818311e47ac56c8d15 SOURCE_GIT_TAG=bd625d43 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.5.0.20200728.152910
ENV __doozer=update BUILD_RELEASE=202007281519.p0 BUILD_VERSION=v4.5.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=5 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.5.0-202007281519.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=bd625d4 OS_GIT_VERSION=4.5.0-202007281519.p0-bd625d4 SOURCE_DATE_EPOCH=1590776927 SOURCE_GIT_COMMIT=bd625d43c6261fc47fd3c9818311e47ac56c8d15 SOURCE_GIT_TAG=bd625d43 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="202007281519.p0" \
        io.openshift.build.commit.id="bd625d43c6261fc47fd3c9818311e47ac56c8d15" \
        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/bd625d43c6261fc47fd3c9818311e47ac56c8d15" \
        version="v4.5.0"

