FROM openshift/golang-builder:rhel_8_golang_1.16 AS build
ENV __doozer=update BUILD_RELEASE=202111041632.p0.git.0d7ecfb.assembly.stream BUILD_VERSION=v4.8.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=8 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.8.0-202111041632.p0.git.0d7ecfb.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=0d7ecfb OS_GIT_VERSION=4.8.0-202111041632.p0.git.0d7ecfb.assembly.stream-0d7ecfb SOURCE_DATE_EPOCH=1616532080 SOURCE_GIT_COMMIT=0d7ecfb5f9ca4603990bb264eae4d998da0e1060 SOURCE_GIT_TAG=0.14.0-1727-g0d7ecfb5 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.8.0.20211104.164221
ENV __doozer=update BUILD_RELEASE=202111041632.p0.git.0d7ecfb.assembly.stream BUILD_VERSION=v4.8.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=8 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.8.0-202111041632.p0.git.0d7ecfb.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=0d7ecfb OS_GIT_VERSION=4.8.0-202111041632.p0.git.0d7ecfb.assembly.stream-0d7ecfb SOURCE_DATE_EPOCH=1616532080 SOURCE_GIT_COMMIT=0d7ecfb5f9ca4603990bb264eae4d998da0e1060 SOURCE_GIT_TAG=0.14.0-1727-g0d7ecfb5 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

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

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." \
        summary="This is a component of OpenShift Container Platform and manages collecting data from monitoring and running reports." \
        io.openshift.tags="openshift" \
        maintainer="<metering-team@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="202111041632.p0.git.0d7ecfb.assembly.stream" \
        io.openshift.build.commit.id="0d7ecfb5f9ca4603990bb264eae4d998da0e1060" \
        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/0d7ecfb5f9ca4603990bb264eae4d998da0e1060" \
        version="v4.8.0"

