FROM openshift/golang-builder:1.12 AS builder
ENV SOURCE_GIT_COMMIT=537d68ec0751a812755779f31d28155cc2afc454 SOURCE_GIT_TAG=v0.0.0-beta1-37-g537d68e SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-gcp SOURCE_DATE_EPOCH=1573644579 BUILD_VERSION=v4.3.2 BUILD_RELEASE=202002112006
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 \
 && make build GOPROXY=off NO_DOCKER=1 CGO_ENABLED=0

FROM openshift/ose-base:v4.3.2.20200211.200621
ENV SOURCE_GIT_COMMIT=537d68ec0751a812755779f31d28155cc2afc454 SOURCE_GIT_TAG=v0.0.0-beta1-37-g537d68e SOURCE_GIT_URL=https://github.com/openshift/cluster-api-provider-gcp SOURCE_DATE_EPOCH=1573644579 BUILD_VERSION=v4.3.2 BUILD_RELEASE=202002112006
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 \
        name="openshift/ose-gcp-machine-controllers" \
        com.redhat.component="ose-gcp-machine-controllers-container" \
        version="v4.3.2" \
        release="202002112006" \
        io.openshift.build.commit.id="537d68ec0751a812755779f31d28155cc2afc454" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-api-provider-gcp" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-api-provider-gcp/commit/537d68ec0751a812755779f31d28155cc2afc454"

