FROM rhel8/go-toolset:1.13 AS builder
ENV SOURCE_GIT_COMMIT=eed2850f2187435ef5d83487e05bf3dc18622ceb SOURCE_DATE_EPOCH=1581603464 BUILD_VERSION=v1.3.0 SOURCE_GIT_URL=https://github.com/openshift/source-to-image SOURCE_GIT_TAG=v1.3.0-11-geed2850f BUILD_RELEASE=202002242346

ENV S2I_GIT_VERSION="" \
    S2I_GIT_MAJOR="" \
    S2I_GIT_MINOR=""


WORKDIR /tmp/source-to-image
COPY . .

USER root

RUN make

RUN cp _output/local/bin/$(go env GOHOSTOS)/$(go env GOHOSTARCH)/s2i _output/s2i
#
# Runner Image
#

FROM ubi8:8-released
ENV SOURCE_GIT_COMMIT=eed2850f2187435ef5d83487e05bf3dc18622ceb SOURCE_DATE_EPOCH=1581603464 BUILD_VERSION=v1.3.0 SOURCE_GIT_URL=https://github.com/openshift/source-to-image SOURCE_GIT_TAG=v1.3.0-11-geed2850f BUILD_RELEASE=202002242346

COPY --from=builder /tmp/source-to-image/_output/s2i  /usr/local/bin/s2i

USER 1001

ENTRYPOINT [ "/usr/local/bin/s2i" ]

LABEL \
        io.k8s.description="source to image" \
        com.redhat.component="source-to-image-container" \
        name="ocp-tools-43-tech-preview/source-to-image-rhel8" \
        io.k8s.display-name="source to image" \
        io.openshift.build.source-location="https://github.com/openshift/source-to-image" \
        io.openshift.build.commit.url="https://github.com/openshift/source-to-image/commit/eed2850f2187435ef5d83487e05bf3dc18622ceb" \
        version="v1.3.0" \
        io.openshift.build.commit.id="eed2850f2187435ef5d83487e05bf3dc18622ceb" \
        release="202010231255"

