FROM openshift/golang-builder:rhel_8_golang_1.15 AS builder
ENV __doozer=update BUILD_RELEASE=202102110027.p0 BUILD_VERSION=v4.7.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=7 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.7.0-202102110027.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=af78e97 OS_GIT_VERSION=4.7.0-202102110027.p0-af78e97 SOURCE_DATE_EPOCH=1605212561 SOURCE_GIT_COMMIT=af78e97a3c6e3b1a92e25ac2a76872da35fa8fdd SOURCE_GIT_TAG=atomic-openshift-node-problem-detector-3.11.233-1.p0-10-gaf78e97 SOURCE_GIT_URL=https://github.com/openshift/node-problem-detector 
WORKDIR /go/src/k8s.io/node-problem-detector
COPY . .
RUN yum install -y systemd-devel && \
    make build-binaries

FROM openshift/ose-base:ubi8
ENV __doozer=update BUILD_RELEASE=202102110027.p0 BUILD_VERSION=v4.7.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=7 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.7.0-202102110027.p0 SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=af78e97 OS_GIT_VERSION=4.7.0-202102110027.p0-af78e97 SOURCE_DATE_EPOCH=1605212561 SOURCE_GIT_COMMIT=af78e97a3c6e3b1a92e25ac2a76872da35fa8fdd SOURCE_GIT_TAG=atomic-openshift-node-problem-detector-3.11.233-1.p0-10-gaf78e97 SOURCE_GIT_URL=https://github.com/openshift/node-problem-detector 
COPY --from=builder /go/src/k8s.io/node-problem-detector/bin/node-problem-detector /usr/bin/
COPY --from=builder /go/src/k8s.io/node-problem-detector/bin/log-counter /usr/bin/

LABEL \
        License="GPLv2+" \
        io.k8s.description="node-problem-detector aims to make various node problems visible to the upstream layers in cluster management stack. It is a daemon which runs on each node, detects node problems and reports them to apiserver." \
        io.k8s.display-name="Node Problem Detector" \
        io.openshift.tags="openshift,node" \
        vendor="Red Hat" \
        name="openshift/ose-node-problem-detector" \
        com.redhat.component="atomic-openshift-node-problem-detector-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Node" \
        release="202102110027.p0" \
        io.openshift.build.commit.id="af78e97a3c6e3b1a92e25ac2a76872da35fa8fdd" \
        io.openshift.build.source-location="https://github.com/openshift/node-problem-detector" \
        io.openshift.build.commit.url="https://github.com/openshift/node-problem-detector/commit/af78e97a3c6e3b1a92e25ac2a76872da35fa8fdd" \
        version="v4.7.0"

