FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202104221811.p0 BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202104221811.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=3a6c689 OS_GIT_VERSION=4.6.0-202104221811.p0-3a6c689 SOURCE_DATE_EPOCH=1614200362 SOURCE_GIT_COMMIT=3a6c689c6c7da5fc2a0488276c98e051c74e89b1 SOURCE_GIT_TAG=v1.0.0-1107-g3a6c689c 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.6.0.20210422.183047
ENV __doozer=update BUILD_RELEASE=202104221811.p0 BUILD_VERSION=v4.6.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=6 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.6.0-202104221811.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=3a6c689 OS_GIT_VERSION=4.6.0-202104221811.p0-3a6c689 SOURCE_DATE_EPOCH=1614200362 SOURCE_GIT_COMMIT=3a6c689c6c7da5fc2a0488276c98e051c74e89b1 SOURCE_GIT_TAG=v1.0.0-1107-g3a6c689c 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="202104221811.p0" \
        io.openshift.build.commit.id="3a6c689c6c7da5fc2a0488276c98e051c74e89b1" \
        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/3a6c689c6c7da5fc2a0488276c98e051c74e89b1" \
        version="v4.6.0"

