FROM openshift/golang-builder:1.11 AS builder
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=28 OS_GIT_VERSION=4.2.28-202004061218-347bcc2 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=347bcc225c9169fd932554ed4d43403ee4085b53 SOURCE_GIT_TAG=347bcc22 SOURCE_GIT_URL=https://github.com/openshift/cluster-nfd-operator SOURCE_DATE_EPOCH=1583951040 OS_GIT_COMMIT=347bcc2 BUILD_VERSION=v4.2.28 BUILD_RELEASE=202004061218
WORKDIR /go/src/github.com/openshift/cluster-nfd-operator
COPY . .
RUN GO111MODULE=on make build

FROM openshift/ose-base:v4.2.28.20200406.121827
ENV OS_GIT_MAJOR=4 OS_GIT_MINOR=2 OS_GIT_PATCH=28 OS_GIT_VERSION=4.2.28-202004061218-347bcc2 OS_GIT_TREE_STATE=clean SOURCE_GIT_COMMIT=347bcc225c9169fd932554ed4d43403ee4085b53 SOURCE_GIT_TAG=347bcc22 SOURCE_GIT_URL=https://github.com/openshift/cluster-nfd-operator SOURCE_DATE_EPOCH=1583951040 OS_GIT_COMMIT=347bcc2 BUILD_VERSION=v4.2.28 BUILD_RELEASE=202004061218
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.28" \
        release="202004061218" \
        io.openshift.build.commit.id="347bcc225c9169fd932554ed4d43403ee4085b53" \
        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/347bcc225c9169fd932554ed4d43403ee4085b53"

