FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202106160913.p0.git.18211b0 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-202106160913.p0.git.18211b0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=18211b0 OS_GIT_VERSION=4.7.0-202106160913.p0.git.18211b0-18211b0 SOURCE_DATE_EPOCH=1623834208 SOURCE_GIT_COMMIT=18211b08ad1d7c4df6dc66acf0fcdf692fa72002 SOURCE_GIT_TAG=18211b08 SOURCE_GIT_URL=https://github.com/openshift/baremetal-operator 
WORKDIR /go/src/github.com/metal3-io/baremetal-operator
COPY . .
RUN make build
RUN make tools

FROM openshift/ose-base:v4.7.0-202106090743.p0.git.0e45f63
ENV __doozer=update BUILD_RELEASE=202106160913.p0.git.18211b0 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-202106160913.p0.git.18211b0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=18211b0 OS_GIT_VERSION=4.7.0-202106160913.p0.git.18211b0-18211b0 SOURCE_DATE_EPOCH=1623834208 SOURCE_GIT_COMMIT=18211b08ad1d7c4df6dc66acf0fcdf692fa72002 SOURCE_GIT_TAG=18211b08 SOURCE_GIT_URL=https://github.com/openshift/baremetal-operator 
COPY --from=builder /go/src/github.com/metal3-io/baremetal-operator/bin/manager /baremetal-operator
COPY --from=builder /go/src/github.com/metal3-io/baremetal-operator/bin/get-hardware-details /
COPY --from=builder /go/src/github.com/metal3-io/baremetal-operator/bin/make-bm-worker /
COPY --from=builder /go/src/github.com/metal3-io/baremetal-operator/bin/make-virt-host /
RUN if ! rpm -q genisoimage; then yum install -y genisoimage && yum clean all && rm -rf /var/cache/yum/*; fi

LABEL \
        name="openshift/ose-baremetal-operator" \
        com.redhat.component="ose-baremetal-operator-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Bare Metal Hardware Provisioning" \
        io.openshift.maintainer.subcomponent="baremetal-operator" \
        release="202106160913.p0.git.18211b0" \
        io.openshift.build.commit.id="18211b08ad1d7c4df6dc66acf0fcdf692fa72002" \
        io.openshift.build.source-location="https://github.com/openshift/baremetal-operator" \
        io.openshift.build.commit.url="https://github.com/openshift/baremetal-operator/commit/18211b08ad1d7c4df6dc66acf0fcdf692fa72002" \
        version="v4.7.0"

