FROM openshift/golang-builder:1.11 AS builder
ENV __doozer=update BUILD_RELEASE=202005050921 BUILD_VERSION=v4.2.32 OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=32 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.2.32-202005050921 
ENV __doozer=merge OS_GIT_COMMIT=b3a05b2 OS_GIT_VERSION=4.2.32-202005050921-b3a05b2 SOURCE_DATE_EPOCH=1588273713 SOURCE_GIT_COMMIT=b3a05b2e61aad309577740140e84532375bec037 SOURCE_GIT_TAG=machine-config-daemon-4.2.32-202005040618 SOURCE_GIT_URL=https://github.com/openshift/machine-config-operator 
WORKDIR /go/src/github.com/openshift/machine-config-operator
COPY . .
RUN WHAT=machine-config-operator ./hack/build-go.sh; \
    mkdir -p /tmp/build; \
    cp /go/src/github.com/openshift/machine-config-operator/_output/linux/$(go env GOARCH)/machine-config-operator /tmp/build/machine-config-operator
RUN WHAT=machine-config-daemon ./hack/build-go.sh; \
    mkdir -p /tmp/build; \
    cp /go/src/github.com/openshift/machine-config-operator/_output/linux/$(go env GOARCH)/machine-config-daemon /tmp/build/machine-config-daemon
RUN WHAT=machine-config-controller ./hack/build-go.sh; \
    mkdir -p /tmp/build; \
    cp /go/src/github.com/openshift/machine-config-operator/_output/linux/$(go env GOARCH)/machine-config-controller /tmp/build/machine-config-controller
RUN WHAT=machine-config-server ./hack/build-go.sh; \
    mkdir -p /tmp/build; \
    cp /go/src/github.com/openshift/machine-config-operator/_output/linux/$(go env GOARCH)/machine-config-server /tmp/build/machine-config-server
RUN WHAT=setup-etcd-environment ./hack/build-go.sh; \
    mkdir -p /tmp/build; \
    cp /go/src/github.com/openshift/machine-config-operator/_output/linux/$(go env GOARCH)/setup-etcd-environment /tmp/build/setup-etcd-environment
RUN WHAT=gcp-routes-controller ./hack/build-go.sh; \
    mkdir -p /tmp/build; \
    cp /go/src/github.com/openshift/machine-config-operator/_output/linux/$(go env GOARCH)/gcp-routes-controller /tmp/build/gcp-routes-controller

FROM openshift/ose-base:v4.2.32.20200505.092140
ENV __doozer=update BUILD_RELEASE=202005050921 BUILD_VERSION=v4.2.32 OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=32 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.2.32-202005050921 
ENV __doozer=merge OS_GIT_COMMIT=b3a05b2 OS_GIT_VERSION=4.2.32-202005050921-b3a05b2 SOURCE_DATE_EPOCH=1588273713 SOURCE_GIT_COMMIT=b3a05b2e61aad309577740140e84532375bec037 SOURCE_GIT_TAG=machine-config-daemon-4.2.32-202005040618 SOURCE_GIT_URL=https://github.com/openshift/machine-config-operator 
COPY --from=builder /tmp/build/machine-config-operator /usr/bin/
COPY install /manifests
COPY --from=builder /tmp/build/machine-config-daemon /usr/bin/
RUN yum install -y util-linux && yum clean all && rm -rf /var/cache/yum/*
COPY --from=builder /tmp/build/machine-config-controller /usr/bin/
COPY templates /etc/mcc/templates
COPY --from=builder /tmp/build/machine-config-server /usr/bin/
COPY --from=builder /tmp/build/setup-etcd-environment /usr/bin/
COPY --from=builder /tmp/build/gcp-routes-controller /usr/bin/
ENTRYPOINT ["/usr/bin/machine-config-operator"]

LABEL \
        io.openshift.release.operator="true" \
        name="openshift/ose-machine-config-operator" \
        com.redhat.component="ose-machine-config-operator-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Machine Config Operator" \
        version="v4.2.32" \
        release="202005050921" \
        io.openshift.build.commit.id="b3a05b2e61aad309577740140e84532375bec037" \
        io.openshift.build.source-location="https://github.com/openshift/machine-config-operator" \
        io.openshift.build.commit.url="https://github.com/openshift/machine-config-operator/commit/b3a05b2e61aad309577740140e84532375bec037"

