FROM openshift/golang-builder:1.11 AS builder
ENV __doozer=update BUILD_RELEASE=202005252115 BUILD_VERSION=v4.2.34 OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=34 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.2.34-202005252115 
ENV __doozer=merge OS_GIT_COMMIT=3029edf OS_GIT_VERSION=4.2.34-202005252115-3029edf SOURCE_DATE_EPOCH=1590157520 SOURCE_GIT_COMMIT=3029edfe0a6f14b3ff3c82129dfbedf33d046ff8 SOURCE_GIT_TAG=machine-config-daemon-4.2.34-202005251712 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.34.20200525.211548
ENV __doozer=update BUILD_RELEASE=202005252115 BUILD_VERSION=v4.2.34 OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=34 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.2.34-202005252115 
ENV __doozer=merge OS_GIT_COMMIT=3029edf OS_GIT_VERSION=4.2.34-202005252115-3029edf SOURCE_DATE_EPOCH=1590157520 SOURCE_GIT_COMMIT=3029edfe0a6f14b3ff3c82129dfbedf33d046ff8 SOURCE_GIT_TAG=machine-config-daemon-4.2.34-202005251712 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.34" \
        release="202005252115" \
        io.openshift.build.commit.id="3029edfe0a6f14b3ff3c82129dfbedf33d046ff8" \
        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/3029edfe0a6f14b3ff3c82129dfbedf33d046ff8"

