#@follow_tag(openshift-golang-builder:1.13)
FROM openshift-golang-builder:v1.13.4-100 AS builder

ENV GOPATH=/go

ARG upstream_version=4.4.0-1-17-ga8da90c
ARG upstream_commit=a8da90cdd978c9b5ea687184c13cb2ce6705aae6
ARG archive=performance-addon-operator-a8da90cdd978c9b5ea687184c13cb2ce6705aae6.tar.gz
ARG project_dir=${GOPATH}/src/github.com/openshift-kni/performance-addon-operators

COPY ${archive} /

RUN mkdir -p ${project_dir} && tar -xzf /${archive} --strip-components 1 -C ${project_dir}
WORKDIR ${project_dir}

RUN make dist

#@follow_tag(ubi8-minimal:8-released)
FROM ubi8-minimal:8.2-267

COPY --from=builder ${project_dir}/build/assets /assets
COPY --from=builder ${project_dir}/build/_output/bin/performance-addon-operators /bin/performance-operator

ENTRYPOINT ["/bin/performance-operator"]

LABEL com.redhat.component="performance-addon-operator-container" \
      name="openshift4/performance-addon-rhel8-operator" \
      version="v4.4.0" \
      upstream-version="4.4.0-1-17-ga8da90c" \
      upstream-vcs-ref="a8da90cdd978c9b5ea687184c13cb2ce6705aae6" \
      upstream-vcs-type="git" \
      summary="performance-addon-operator" \
      io.openshift.expose-services="" \
      io.openshift.tags="operator" \
      io.k8s.display-name="performance-addon-operator" \
      maintainer="openshift-operators@redhat.com" \
      description="performance-addon-operator"
