FROM openshift/golang-builder:1.12 AS builder
ENV SOURCE_GIT_COMMIT=c01d2de651071389d2621c46e934fd9cb2bf4b8d SOURCE_GIT_TAG=c01d2de SOURCE_GIT_URL=https://github.com/openshift/openshift-state-metrics SOURCE_DATE_EPOCH=1568793514 BUILD_VERSION=v4.3.3 BUILD_RELEASE=202002171705
WORKDIR /go/src/github.com/openshift/openshift-state-metrics
COPY . .
RUN make build

FROM openshift/ose-base:v4.3.3.20200217.170535
ENV SOURCE_GIT_COMMIT=c01d2de651071389d2621c46e934fd9cb2bf4b8d SOURCE_GIT_TAG=c01d2de SOURCE_GIT_URL=https://github.com/openshift/openshift-state-metrics SOURCE_DATE_EPOCH=1568793514 BUILD_VERSION=v4.3.3 BUILD_RELEASE=202002171705

ARG FROM_DIRECTORY=/go/src/github.com/openshift/openshift-state-metrics
COPY --from=builder ${FROM_DIRECTORY}/openshift-state-metrics  /usr/bin/openshift-state-metrics

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

LABEL \
        io.k8s.display-name="openshift-state-metrics" \
        io.k8s.description="This is a component that exposes metrics about OpenShift objects." \
        io.openshift.tags="OpenShift" \
        maintainer="Haoran Wang <haowang@redhat.com>" \
        name="openshift/ose-openshift-state-metrics" \
        com.redhat.component="openshift-state-metrics-container" \
        version="v4.3.3" \
        release="202002171705" \
        io.openshift.build.commit.id="c01d2de651071389d2621c46e934fd9cb2bf4b8d" \
        io.openshift.build.source-location="https://github.com/openshift/openshift-state-metrics" \
        io.openshift.build.commit.url="https://github.com/openshift/openshift-state-metrics/commit/c01d2de651071389d2621c46e934fd9cb2bf4b8d"

