FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=fcb0301bc83c38c9f904c61a63608996c5c7bbd9 SOURCE_DATE_EPOCH=1576772243 BUILD_VERSION=v4.2.13 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-aws SOURCE_GIT_TAG=v0.2.0-177-gfcb0301b BUILD_RELEASE=201912230557
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.13.20191223.055734
ENV SOURCE_GIT_COMMIT=fcb0301bc83c38c9f904c61a63608996c5c7bbd9 SOURCE_DATE_EPOCH=1576772243 BUILD_VERSION=v4.2.13 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-aws SOURCE_GIT_TAG=v0.2.0-177-gfcb0301b BUILD_RELEASE=201912230557
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/fcb0301bc83c38c9f904c61a63608996c5c7bbd9" \
        version="v4.2.13" \
        name="openshift/ose-aws-machine-controllers" \
        io.openshift.build.commit.id="fcb0301bc83c38c9f904c61a63608996c5c7bbd9" \
        release="201912230557" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-api-provider-aws"

