FROM openshift/golang-builder:1.11 AS build
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=24 OS_GIT_VERSION=4.2.24-202003161048-dd9a252 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=dd9a252ca8f7bb1be3000f18cb79cf890a55209a SOURCE_GIT_TAG=dd9a252 SOURCE_GIT_URL=https://github.com/operator-framework/operator-metering SOURCE_DATE_EPOCH=1578715254 OS_GIT_COMMIT=dd9a252 BUILD_VERSION=v4.2.24 BUILD_RELEASE=202003161048

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

RUN make reporting-operator-bin RUN_UPDATE_CODEGEN=false CHECK_GO_FILES=false

FROM openshift/ose-base:v4.2.24.20200316.104823
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=24 OS_GIT_VERSION=4.2.24-202003161048-dd9a252 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=dd9a252ca8f7bb1be3000f18cb79cf890a55209a SOURCE_GIT_TAG=dd9a252 SOURCE_GIT_URL=https://github.com/operator-framework/operator-metering SOURCE_DATE_EPOCH=1578715254 OS_GIT_COMMIT=dd9a252 BUILD_VERSION=v4.2.24 BUILD_RELEASE=202003161048

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.2.24" \
        release="202003161048" \
        io.openshift.build.commit.id="dd9a252ca8f7bb1be3000f18cb79cf890a55209a" \
        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/dd9a252ca8f7bb1be3000f18cb79cf890a55209a"

