ARG BUILD_DIR=/tmp/github.com/redhat-developer/service-binding-operator

FROM registry.redhat.io/rhel8/go-toolset:1.15 AS builder

USER root

ARG BUILD_DIR

WORKDIR $BUILD_DIR

# TODO: Use a RUN command to copy over specific files/dirs in a different PR
# Collapsing it into a single COPY to reduce layers, as of now.
COPY service-binding-operator-9230857d0d6d5eb542cf95149bfe2511ed96ddbb.tar.gz .

RUN tar xf service-binding-operator-9230857d0d6d5eb542cf95149bfe2511ed96ddbb.tar.gz --strip-components=1 && rm service-binding-operator-9230857d0d6d5eb542cf95149bfe2511ed96ddbb.tar.gz

RUN make build


#--------------------------------------------------------------------

#@follow_tag(ubi8-minimal:8-released)
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4

ARG BUILD_DIR

WORKDIR /
COPY --from=builder $BUILD_DIR/bin/manager .

USER 10001

ENTRYPOINT ["/manager"]

LABEL com.redhat.component="service-binding-operator-container" \
	name="ocp-tools-4/service-binding-rhel8-operator" \
	description="Service Binding Operator" \
	summary="Service Binding Operator" \
	io.openshift.tags="service,binding" \
	maintainer="service-binding-support@redhat.com" \
	version="v1.0.0" \
    io.k8s.display-name="The Service Binding Operator" \
    io.openshift.build.source-location="https://github.com/redhat-developer/service-binding-operator" \
    io.openshift.build.commit.url="https://github.com/redhat-developer/service-binding-operator/commit/9230857d0d6d5eb542cf95149bfe2511ed96ddbb" \
    io.openshift.build.commit.id="9230857d0d6d5eb542cf95149bfe2511ed96ddbb"
