FROM openshift/golang-builder:1.11 AS builder
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=29 OS_GIT_VERSION=4.2.29-202004140532-1d3b7fe OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=1d3b7fe6d5c3ecfe558b6d3130f8075a049ae507 SOURCE_GIT_TAG=1d3b7fe6 SOURCE_GIT_URL=https://github.com/openshift/cluster-nfd-operator SOURCE_DATE_EPOCH=1586656367 OS_GIT_COMMIT=1d3b7fe BUILD_VERSION=v4.2.29 BUILD_RELEASE=202004140532
WORKDIR /go/src/github.com/openshift/cluster-nfd-operator
COPY . .
RUN GO111MODULE=on make build

FROM openshift/ose-base:v4.2.29.20200414.053300
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=29 OS_GIT_VERSION=4.2.29-202004140532-1d3b7fe OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=1d3b7fe6d5c3ecfe558b6d3130f8075a049ae507 SOURCE_GIT_TAG=1d3b7fe6 SOURCE_GIT_URL=https://github.com/openshift/cluster-nfd-operator SOURCE_DATE_EPOCH=1586656367 OS_GIT_COMMIT=1d3b7fe BUILD_VERSION=v4.2.29 BUILD_RELEASE=202004140532
ARG CSV=4.2
COPY --from=builder /go/src/github.com/openshift/cluster-nfd-operator/cluster-nfd-operator /usr/bin/

RUN mkdir -p /opt/nfd
COPY assets /opt/nfd

#ADD controller-manifests /manifests
COPY manifests/olm-catalog/$CSV /manifests/$CSV
COPY manifests/olm-catalog/nfd.package.yaml /manifests/

RUN useradd cluster-nfd-operator
USER cluster-nfd-operator
ENTRYPOINT ["/usr/bin/cluster-nfd-operator"]

LABEL \
        io.k8s.display-name="OpenShift cluster-nfd-operator" \
        io.k8s.description="This is a component of OpenShift and manages the node feature discovery." \
        io.openshift.tags="openshift" \
        com.redhat.delivery.appregistry="false" \
        maintainer="ATS Auto Tuning Scalability  <aos-scalability@redhat.com>" \
        name="openshift/ose-cluster-nfd-operator" \
        com.redhat.component="cluster-nfd-operator-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        version="v4.2.29" \
        release="202004140532" \
        io.openshift.build.commit.id="1d3b7fe6d5c3ecfe558b6d3130f8075a049ae507" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-nfd-operator" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-nfd-operator/commit/1d3b7fe6d5c3ecfe558b6d3130f8075a049ae507"

