FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202105211924.p0 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-202105211924.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=e179bb5 OS_GIT_VERSION=4.7.0-202105211924.p0-e179bb5 SOURCE_DATE_EPOCH=1621620980 SOURCE_GIT_COMMIT=e179bb5ce397b543cd3f716f75fa4cd40046e0ad SOURCE_GIT_TAG=v0.2.0-1130-ge179bb5c SOURCE_GIT_URL=https://github.com/openshift/machine-api-operator 
WORKDIR /go/src/github.com/openshift/machine-api-operator
COPY . .
RUN NO_DOCKER=1 make build

FROM openshift/ose-base:v4.7.0-202105210300.p0
ENV __doozer=update BUILD_RELEASE=202105211924.p0 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-202105211924.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=e179bb5 OS_GIT_VERSION=4.7.0-202105211924.p0-e179bb5 SOURCE_DATE_EPOCH=1621620980 SOURCE_GIT_COMMIT=e179bb5ce397b543cd3f716f75fa4cd40046e0ad SOURCE_GIT_TAG=v0.2.0-1130-ge179bb5c SOURCE_GIT_URL=https://github.com/openshift/machine-api-operator 
COPY --from=builder /go/src/github.com/openshift/machine-api-operator/install manifests
COPY --from=builder /go/src/github.com/openshift/machine-api-operator/bin/machine-api-operator .
COPY --from=builder /go/src/github.com/openshift/machine-api-operator/bin/nodelink-controller .
COPY --from=builder /go/src/github.com/openshift/machine-api-operator/bin/machine-healthcheck .
COPY --from=builder /go/src/github.com/openshift/machine-api-operator/bin/machineset ./machineset-controller
COPY --from=builder /go/src/github.com/openshift/machine-api-operator/bin/vsphere ./machine-controller-manager

LABEL \
        io.openshift.release.operator="true" \
        name="openshift/ose-machine-api-operator" \
        com.redhat.component="ose-machine-api-operator-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Cloud Compute" \
        release="202105211924.p0" \
        io.openshift.build.commit.id="e179bb5ce397b543cd3f716f75fa4cd40046e0ad" \
        io.openshift.build.source-location="https://github.com/openshift/machine-api-operator" \
        io.openshift.build.commit.url="https://github.com/openshift/machine-api-operator/commit/e179bb5ce397b543cd3f716f75fa4cd40046e0ad" \
        version="v4.7.0"

