# This Dockerfile is a used by CI to publish openshift/origin-v4.0:installer-artifacts
# It builds an image containing the Mac version of the installer layered on top of the
# Linux installer image.

FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=2d2fc140ccdb167c690df5b2693a23d07a8109d2 SOURCE_DATE_EPOCH=1572839157 BUILD_VERSION=v4.1.25 SOURCE_GIT_URL=https://github.com/openshift/ose SOURCE_GIT_TAG=v4.1.21-201910220952-12-g2d2fc140c BUILD_RELEASE=201911190028
WORKDIR /go/src/github.com/openshift/origin
COPY . .
RUN OS_RELEASE_WITHOUT_LINKS=y OS_BUILD_RELEASE_ARCHIVES=n OS_ONLY_BUILD_PLATFORMS="^(darwin|windows)/amd64$" bash -x hack/build-cross.sh

FROM openshift/ose-cli:v4.1.25.20191119.002830
ENV SOURCE_GIT_COMMIT=2d2fc140ccdb167c690df5b2693a23d07a8109d2 SOURCE_DATE_EPOCH=1572839157 BUILD_VERSION=v4.1.25 SOURCE_GIT_URL=https://github.com/openshift/ose SOURCE_GIT_TAG=v4.1.21-201910220952-12-g2d2fc140c BUILD_RELEASE=201911190028
COPY --from=builder /go/src/github.com/openshift/origin/_output/local/bin/darwin/amd64/oc /usr/share/openshift/mac/oc
COPY --from=builder /go/src/github.com/openshift/origin/_output/local/bin/windows/amd64/oc.exe /usr/share/openshift/windows/oc.exe

LABEL \
        com.redhat.component="ose-cli-artifacts-container" \
        io.openshift.build.commit.url="https://github.com/openshift/ose/commit/2d2fc140ccdb167c690df5b2693a23d07a8109d2" \
        version="v4.1.25" \
        name="openshift/ose-cli-artifacts" \
        io.openshift.build.commit.id="2d2fc140ccdb167c690df5b2693a23d07a8109d2" \
        release="201911190028" \
        io.openshift.build.source-location="https://github.com/openshift/ose"

