FROM openshift/golang-builder:1.13 AS builder
ENV __doozer=update BUILD_RELEASE=202010151500.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-202010151500.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=6a02b0eebb57b0b69141b1ee1d3cc35885256173 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=13+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.13.0+6a02b0e OS_GIT_COMMIT=6a02b0e OS_GIT_VERSION=4.5.0-202010151500.p0-6a02b0e SOURCE_DATE_EPOCH=1598577250 SOURCE_GIT_COMMIT=6a02b0eebb57b0b69141b1ee1d3cc35885256173 SOURCE_GIT_TAG=6a02b0ee 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.5.0.20201015.152216
ENV __doozer=update BUILD_RELEASE=202010151500.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-202010151500.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge KUBE_GIT_COMMIT=6a02b0eebb57b0b69141b1ee1d3cc35885256173 KUBE_GIT_MAJOR=1 KUBE_GIT_MINOR=13+ KUBE_GIT_TREE_STATE=clean KUBE_GIT_VERSION=v1.13.0+6a02b0e OS_GIT_COMMIT=6a02b0e OS_GIT_VERSION=4.5.0-202010151500.p0-6a02b0e SOURCE_DATE_EPOCH=1598577250 SOURCE_GIT_COMMIT=6a02b0eebb57b0b69141b1ee1d3cc35885256173 SOURCE_GIT_TAG=6a02b0ee SOURCE_GIT_URL=https://github.com/openshift/baremetal-operator 
COPY --from=builder /go/src/github.com/metal3-io/baremetal-operator/build/_output/bin/baremetal-operator /
COPY --from=builder /go/src/github.com/metal3-io/baremetal-operator/build/_output/bin/get-hardware-details /
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="202010151500.p0" \
        io.openshift.build.commit.id="6a02b0eebb57b0b69141b1ee1d3cc35885256173" \
        io.openshift.build.source-location="https://github.com/openshift/baremetal-operator" \
        io.openshift.build.commit.url="https://github.com/openshift/baremetal-operator/commit/6a02b0eebb57b0b69141b1ee1d3cc35885256173" \
        version="v4.5.0"

