FROM openshift/golang-builder:1.13 AS builder
ENV __doozer=update BUILD_RELEASE=202104130540.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-202104130540.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=44c80c3 OS_GIT_VERSION=4.5.0-202104130540.p0-44c80c3 SOURCE_DATE_EPOCH=1601680376 SOURCE_GIT_COMMIT=44c80c35ff2f98feb3a304f2a81f05ba8e01cef1 SOURCE_GIT_TAG=v1.0.0-1098-g44c80c35 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.5.0.20210413.055233
ENV __doozer=update BUILD_RELEASE=202104130540.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-202104130540.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=44c80c3 OS_GIT_VERSION=4.5.0-202104130540.p0-44c80c3 SOURCE_DATE_EPOCH=1601680376 SOURCE_GIT_COMMIT=44c80c35ff2f98feb3a304f2a81f05ba8e01cef1 SOURCE_GIT_TAG=v1.0.0-1098-g44c80c35 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" \
        maintainer="Frederic Branczyk <fbranczy@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="202104130540.p0" \
        io.openshift.build.commit.id="44c80c35ff2f98feb3a304f2a81f05ba8e01cef1" \
        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/44c80c35ff2f98feb3a304f2a81f05ba8e01cef1" \
        version="v4.5.0"

