FROM openshift/golang-builder:1.12 AS builder
ENV SOURCE_GIT_COMMIT=b59f34398847fd2047f4f1193654b505643afe79 SOURCE_DATE_EPOCH=1578413487 BUILD_VERSION=v4.3.0 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-aws SOURCE_GIT_TAG=b59f3439 BUILD_RELEASE=202001211731
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.0.20200121.173126
ENV SOURCE_GIT_COMMIT=b59f34398847fd2047f4f1193654b505643afe79 SOURCE_DATE_EPOCH=1578413487 BUILD_VERSION=v4.3.0 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-aws SOURCE_GIT_TAG=b59f3439 BUILD_RELEASE=202001211731
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 \
        com.redhat.component="ose-aws-machine-controllers-container" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-api-provider-aws/commit/b59f34398847fd2047f4f1193654b505643afe79" \
        version="v4.3.0" \
        name="openshift/ose-aws-machine-controllers" \
        io.openshift.build.commit.id="b59f34398847fd2047f4f1193654b505643afe79" \
        release="202001211731" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-api-provider-aws"

