FROM openshift/golang-builder:1.12 AS build
ENV SOURCE_GIT_COMMIT=44d9b0329bf6ef52049f122e4760ef4e66e72e52 SOURCE_GIT_TAG=44d9b03 SOURCE_GIT_URL=https://github.com/operator-framework/operator-metering SOURCE_DATE_EPOCH=1580854051 BUILD_VERSION=v4.3.2 BUILD_RELEASE=202002112006

COPY . /go/src/github.com/operator-framework/operator-metering
WORKDIR /go/src/github.com/operator-framework/operator-metering

ENV GOCACHE='/tmp'
RUN make reporting-operator-bin RUN_UPDATE_CODEGEN=false CHECK_GO_FILES=false

FROM openshift/ose-base:v4.3.2.20200211.200621
ENV SOURCE_GIT_COMMIT=44d9b0329bf6ef52049f122e4760ef4e66e72e52 SOURCE_GIT_TAG=44d9b03 SOURCE_GIT_URL=https://github.com/operator-framework/operator-metering SOURCE_DATE_EPOCH=1580854051 BUILD_VERSION=v4.3.2 BUILD_RELEASE=202002112006

RUN yum install --setopt=skip_missing_names_on_install=False -y \
        ca-certificates bash

COPY --from=build /go/src/github.com/operator-framework/operator-metering/bin/reporting-operator /usr/local/bin/reporting-operator


ENTRYPOINT ["reporting-operator"]
CMD ["start"]

USER 3001

LABEL \
        io.k8s.display-name="OpenShift metering-reporting-operator" \
        io.k8s.description="This is a component of OpenShift Container Platform and manages collecting data from monitoring and running reports." \
        io.openshift.tags="openshift" \
        maintainer="Chance Zibolski <czibolsk@redhat.com>" \
        name="openshift/ose-metering-reporting-operator" \
        com.redhat.component="ose-metering-reporting-operator-container" \
        version="v4.3.2" \
        release="202002112006" \
        io.openshift.build.commit.id="44d9b0329bf6ef52049f122e4760ef4e66e72e52" \
        io.openshift.build.source-location="https://github.com/operator-framework/operator-metering" \
        io.openshift.build.commit.url="https://github.com/operator-framework/operator-metering/commit/44d9b0329bf6ef52049f122e4760ef4e66e72e52"

