FROM openshift/golang-builder:rhel_8_golang_1.16 AS builder
ENV __doozer=update BUILD_RELEASE=202107231447.p0.git.9471662.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-202107231447.p0.git.9471662.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=9471662 OS_GIT_VERSION=4.8.0-202107231447.p0.git.9471662.assembly.stream-9471662 SOURCE_DATE_EPOCH=1620218353 SOURCE_GIT_COMMIT=947166293195d115500d4479c0c40c8c01a25ad0 SOURCE_GIT_TAG=v1.0.0-1534-g94716629 SOURCE_GIT_URL=https://github.com/openshift/kube-state-metrics 
WORKDIR /go/src/k8s.io/kube-state-metrics
COPY . .
ENV GOFLAGS="-mod=vendor"
RUN make build-local

FROM openshift/ose-base:v4.8.0.20210723.145548
ENV __doozer=update BUILD_RELEASE=202107231447.p0.git.9471662.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-202107231447.p0.git.9471662.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=9471662 OS_GIT_VERSION=4.8.0-202107231447.p0.git.9471662.assembly.stream-9471662 SOURCE_DATE_EPOCH=1620218353 SOURCE_GIT_COMMIT=947166293195d115500d4479c0c40c8c01a25ad0 SOURCE_GIT_TAG=v1.0.0-1534-g94716629 SOURCE_GIT_URL=https://github.com/openshift/kube-state-metrics 

ARG FROM_DIRECTORY=/go/src/k8s.io/kube-state-metrics
COPY --from=builder ${FROM_DIRECTORY}/kube-state-metrics  /usr/bin/kube-state-metrics

USER nobody
ENTRYPOINT ["/usr/bin/kube-state-metrics"]

LABEL \
        io.k8s.display-name="kube-state-metrics" \
        io.k8s.description="This is a component that exposes metrics about Kubernetes objects." \
        io.openshift.tags="kubernetes" \
        summary="This is a component that exposes metrics about Kubernetes objects." \
        maintainer="OpenShift Monitoring Team <team-monitoring@redhat.com>" \
        License="ASL 2.0" \
        vendor="Red Hat" \
        name="openshift/ose-kube-state-metrics" \
        com.redhat.component="kube-state-metrics-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Monitoring" \
        release="202107231447.p0.git.9471662.assembly.stream" \
        io.openshift.build.commit.id="947166293195d115500d4479c0c40c8c01a25ad0" \
        io.openshift.build.source-location="https://github.com/openshift/kube-state-metrics" \
        io.openshift.build.commit.url="https://github.com/openshift/kube-state-metrics/commit/947166293195d115500d4479c0c40c8c01a25ad0" \
        version="v4.8.0"

