FROM openshift/golang-builder:1.12 AS builder
ENV __doozer=update BUILD_RELEASE=202005121847 BUILD_VERSION=v4.3.20 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=20 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.20-202005121847 
ENV __doozer=merge OS_GIT_COMMIT=86a378f OS_GIT_VERSION=4.3.20-202005121847-86a378f SOURCE_DATE_EPOCH=1583507396 SOURCE_GIT_COMMIT=86a378fedb20eb9a998047407594baabe80dc345 SOURCE_GIT_TAG=86a378fe SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-aws 
WORKDIR /go/src/sigs.k8s.io/cluster-api-provider-aws
COPY . .
# VERSION env gets set in the openshift/release image and refers to the golang version, which interfers with our own
RUN unset VERSION \
 && GOPROXY=off NO_DOCKER=1 make build

FROM openshift/ose-base:v4.3.20.20200512.184737
ENV __doozer=update BUILD_RELEASE=202005121847 BUILD_VERSION=v4.3.20 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=20 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.20-202005121847 
ENV __doozer=merge OS_GIT_COMMIT=86a378f OS_GIT_VERSION=4.3.20-202005121847-86a378f SOURCE_DATE_EPOCH=1583507396 SOURCE_GIT_COMMIT=86a378fedb20eb9a998047407594baabe80dc345 SOURCE_GIT_TAG=86a378fe SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-aws 
RUN INSTALL_PKGS=" \
      openssh \
      " && \
    yum install -y $INSTALL_PKGS && \
    rpm -V $INSTALL_PKGS && \
    yum clean all
COPY --from=builder /go/src/sigs.k8s.io/cluster-api-provider-aws/bin/manager /
COPY --from=builder /go/src/sigs.k8s.io/cluster-api-provider-aws/bin/machine-controller-manager /

LABEL \
        name="openshift/ose-aws-machine-controllers" \
        com.redhat.component="ose-aws-machine-controllers-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        version="v4.3.20" \
        release="202005121847" \
        io.openshift.build.commit.id="86a378fedb20eb9a998047407594baabe80dc345" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-api-provider-aws" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-api-provider-aws/commit/86a378fedb20eb9a998047407594baabe80dc345"

