FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=75ed797523afaa1ba457b5a92ec6540673850f49 SOURCE_GIT_TAG=v0.2.0-196-g75ed7975 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-aws SOURCE_DATE_EPOCH=1582194462 BUILD_VERSION=v4.2.21 BUILD_RELEASE=202002240343
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.2.21.20200224.034357
ENV SOURCE_GIT_COMMIT=75ed797523afaa1ba457b5a92ec6540673850f49 SOURCE_GIT_TAG=v0.2.0-196-g75ed7975 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-aws SOURCE_DATE_EPOCH=1582194462 BUILD_VERSION=v4.2.21 BUILD_RELEASE=202002240343
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.2.21" \
        release="202002240343" \
        io.openshift.build.commit.id="75ed797523afaa1ba457b5a92ec6540673850f49" \
        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/75ed797523afaa1ba457b5a92ec6540673850f49"

