FROM openshift/golang-builder:1.12 AS builder
ENV __doozer=update BUILD_RELEASE=202007272153.p0 BUILD_VERSION=v4.3.31 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=31 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.31-202007272153.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=86a378f OS_GIT_VERSION=4.3.31-202007272153.p0-86a378f SOURCE_DATE_EPOCH=1583507396 SOURCE_GIT_COMMIT=86a378fedb20eb9a998047407594baabe80dc345 SOURCE_GIT_TAG=v0.2.0-215-g86a378fe 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.31.20200727.215312
ENV __doozer=update BUILD_RELEASE=202007272153.p0 BUILD_VERSION=v4.3.31 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=31 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.31-202007272153.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=86a378f OS_GIT_VERSION=4.3.31-202007272153.p0-86a378f SOURCE_DATE_EPOCH=1583507396 SOURCE_GIT_COMMIT=86a378fedb20eb9a998047407594baabe80dc345 SOURCE_GIT_TAG=v0.2.0-215-g86a378fe 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" \
        release="202007272153.p0" \
        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" \
        version="v4.3.31"

