FROM openshift/golang-builder:1.12 AS builder
ENV SOURCE_GIT_COMMIT=602750a8c1762faf052124fc400b9342514ed8f3 SOURCE_DATE_EPOCH=1568724006 BUILD_VERSION=v4.2.1 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-gcp SOURCE_GIT_TAG=v0.0.0-beta1-28-g602750a BUILD_RELEASE=201910221723
WORKDIR /go/src/github.com/openshift/cluster-api-provider-gcp
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.1.20191022.172340
ENV SOURCE_GIT_COMMIT=602750a8c1762faf052124fc400b9342514ed8f3 SOURCE_DATE_EPOCH=1568724006 BUILD_VERSION=v4.2.1 SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-gcp SOURCE_GIT_TAG=v0.0.0-beta1-28-g602750a BUILD_RELEASE=201910221723
COPY --from=builder /go/src/github.com/openshift/cluster-api-provider-gcp/bin/manager /
COPY --from=builder /go/src/github.com/openshift/cluster-api-provider-gcp/bin/machine-controller-manager /

LABEL \
        com.redhat.component="ose-gcp-machine-controllers-container" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-api-provider-gcp/commit/602750a8c1762faf052124fc400b9342514ed8f3" \
        version="v4.2.1" \
        name="openshift/ose-gcp-machine-controllers" \
        io.openshift.build.commit.id="602750a8c1762faf052124fc400b9342514ed8f3" \
        release="201910221723" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-api-provider-gcp"

