FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=d77b7ae80f23ce511c620f095e8d10844929311c SOURCE_DATE_EPOCH=1568723921 BUILD_VERSION=v4.2.8 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-aws SOURCE_GIT_TAG=v0.2.0-175-gd77b7ae8 BUILD_RELEASE=201911190952
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.8.20191119.095254
ENV SOURCE_GIT_COMMIT=d77b7ae80f23ce511c620f095e8d10844929311c SOURCE_DATE_EPOCH=1568723921 BUILD_VERSION=v4.2.8 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-aws SOURCE_GIT_TAG=v0.2.0-175-gd77b7ae8 BUILD_RELEASE=201911190952
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/d77b7ae80f23ce511c620f095e8d10844929311c" \
        version="v4.2.8" \
        name="openshift/ose-aws-machine-controllers" \
        io.openshift.build.commit.id="d77b7ae80f23ce511c620f095e8d10844929311c" \
        release="201911190952" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-api-provider-aws"

