FROM openshift/golang-builder:1.12 AS builder
ENV __doozer=update BUILD_RELEASE=202004200457 BUILD_VERSION=v4.3.14 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=14 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.14-202004200457 
ENV __doozer=merge OS_GIT_COMMIT=d0b913a OS_GIT_VERSION=4.3.14-202004200457-d0b913a SOURCE_DATE_EPOCH=1582154681 SOURCE_GIT_COMMIT=d0b913aa0dc58d87bab16ed5a8799a9e06891705 SOURCE_GIT_TAG=d0b913a SOURCE_GIT_URL=https://github.com/openshift/node_exporter 

WORKDIR /go/src/github.com/prometheus/node_exporter
COPY . .
RUN if yum install -y prometheus-promu; then export BUILD_PROMU=false; fi && make build

FROM openshift/ose-base:ubi7
ENV __doozer=update BUILD_RELEASE=202004200457 BUILD_VERSION=v4.3.14 OS_GIT_MAJOR=4 OS_GIT_MINOR=3 OS_GIT_PATCH=14 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.3.14-202004200457 
ENV __doozer=merge OS_GIT_COMMIT=d0b913a OS_GIT_VERSION=4.3.14-202004200457-d0b913a SOURCE_DATE_EPOCH=1582154681 SOURCE_GIT_COMMIT=d0b913aa0dc58d87bab16ed5a8799a9e06891705 SOURCE_GIT_TAG=d0b913a SOURCE_GIT_URL=https://github.com/openshift/node_exporter 

COPY --from=builder /go/src/github.com/prometheus/node_exporter/node_exporter /bin/node_exporter

RUN yum install -y virt-what && yum clean all && rm -rf /var/cache/*
COPY text_collectors/virt.sh /node_exporter/collectors/init/

EXPOSE      9100
USER        nobody
ENTRYPOINT  [ "/bin/node_exporter" ]

LABEL \
        io.k8s.display-name="Node Exporter" \
        io.k8s.description="Prometheus exporter for hardware and OS metrics exposed by *NIX kernels, written in Go with pluggable metric collectors" \
        io.openshift.tags="openshift,node" \
        maintainer="The Prometheus Authors <prometheus-developers@googlegroups.com>" \
        License="ASL 2.0" \
        vendor="Red Hat" \
        name="openshift/ose-prometheus-node-exporter" \
        com.redhat.component="golang-github-prometheus-node_exporter-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Monitoring" \
        version="v4.3.14" \
        release="202004200457" \
        io.openshift.build.commit.id="d0b913aa0dc58d87bab16ed5a8799a9e06891705" \
        io.openshift.build.source-location="https://github.com/openshift/node_exporter" \
        io.openshift.build.commit.url="https://github.com/openshift/node_exporter/commit/d0b913aa0dc58d87bab16ed5a8799a9e06891705"

