# This Dockerfile 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=90ccb37ac1f85ae811c50a29f9bb7e779c5045fb SOURCE_DATE_EPOCH=1570646453 BUILD_VERSION=v4.2.0 SOURCE_GIT_URL=https://github.com/openshift/installer SOURCE_GIT_TAG=90ccb37a BUILD_RELEASE=201910101614
WORKDIR /go/src/github.com/openshift/installer
COPY . .
RUN go generate ./data && \
    SKIP_GENERATION=y GOOS=darwin GOARCH=amd64 hack/build.sh

FROM openshift/ose-installer:v4.2.0.20191010.161456
ENV SOURCE_GIT_COMMIT=90ccb37ac1f85ae811c50a29f9bb7e779c5045fb SOURCE_DATE_EPOCH=1570646453 BUILD_VERSION=v4.2.0 SOURCE_GIT_URL=https://github.com/openshift/installer SOURCE_GIT_TAG=90ccb37a BUILD_RELEASE=201910101614
COPY --from=builder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/mac/openshift-install

LABEL \
        com.redhat.component="ose-installer-artifacts-container" \
        io.openshift.build.commit.url="https://github.com/openshift/installer/commit/90ccb37ac1f85ae811c50a29f9bb7e779c5045fb" \
        version="v4.2.0" \
        name="openshift/ose-installer-artifacts" \
        io.openshift.build.commit.id="90ccb37ac1f85ae811c50a29f9bb7e779c5045fb" \
        release="201910101614" \
        io.openshift.build.source-location="https://github.com/openshift/installer"

