FROM openshift/golang-builder:1.13 AS build
ENV __doozer=update BUILD_RELEASE=202007131801.p0 BUILD_VERSION=v4.5.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=5 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.5.0-202007131801.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=881613e OS_GIT_VERSION=4.5.0-202007131801.p0-881613e SOURCE_DATE_EPOCH=1592315066 SOURCE_GIT_COMMIT=881613e2e9e3a760f0b79e97a08b12072cc44f9e SOURCE_GIT_TAG=0.14.0-1162-g881613e2 SOURCE_GIT_URL=https://github.com/kube-reporting/metering-operator 

COPY . /go/src/github.com/kube-reporting/metering-operator
WORKDIR /go/src/github.com/kube-reporting/metering-operator

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

FROM openshift/ose-base:v4.5.0.20200713.182304
ENV __doozer=update BUILD_RELEASE=202007131801.p0 BUILD_VERSION=v4.5.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=5 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.5.0-202007131801.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=881613e OS_GIT_VERSION=4.5.0-202007131801.p0-881613e SOURCE_DATE_EPOCH=1592315066 SOURCE_GIT_COMMIT=881613e2e9e3a760f0b79e97a08b12072cc44f9e SOURCE_GIT_TAG=0.14.0-1162-g881613e2 SOURCE_GIT_URL=https://github.com/kube-reporting/metering-operator 

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

COPY --from=build /go/src/github.com/kube-reporting/metering-operator/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="sd-operator-metering@redhat.com" \
        name="openshift/ose-metering-reporting-operator" \
        com.redhat.component="ose-metering-reporting-operator-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Metering Operator" \
        release="202007131801.p0" \
        io.openshift.build.commit.id="881613e2e9e3a760f0b79e97a08b12072cc44f9e" \
        io.openshift.build.source-location="https://github.com/kube-reporting/metering-operator" \
        io.openshift.build.commit.url="https://github.com/kube-reporting/metering-operator/commit/881613e2e9e3a760f0b79e97a08b12072cc44f9e" \
        version="v4.5.0"

