FROM openshift/golang-builder:1.12 AS builder
ENV SOURCE_GIT_COMMIT=3ce21b387b2b30fe9755b227f1bcfaa012d39767 SOURCE_GIT_TAG=3ce21b38 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-aws SOURCE_DATE_EPOCH=1581690578 BUILD_VERSION=v4.3.3 BUILD_RELEASE=202002171705
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.3.20200217.170535
ENV SOURCE_GIT_COMMIT=3ce21b387b2b30fe9755b227f1bcfaa012d39767 SOURCE_GIT_TAG=3ce21b38 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-aws SOURCE_DATE_EPOCH=1581690578 BUILD_VERSION=v4.3.3 BUILD_RELEASE=202002171705
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" \
        version="v4.3.3" \
        release="202002171705" \
        io.openshift.build.commit.id="3ce21b387b2b30fe9755b227f1bcfaa012d39767" \
        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/3ce21b387b2b30fe9755b227f1bcfaa012d39767"

