FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=fab30b2e11ad5ebbf420775cc076fba6359f9f26 SOURCE_DATE_EPOCH=1574952268 BUILD_VERSION=v4.2.14 SOURCE_GIT_URL=https://github.com/openshift/cluster-nfd-operator SOURCE_GIT_TAG=fab30b2 BUILD_RELEASE=202001061701
WORKDIR /go/src/github.com/openshift/cluster-nfd-operator
COPY . .
RUN make build

FROM openshift/ose-base:v4.2.14.20200106.170123
ENV SOURCE_GIT_COMMIT=fab30b2e11ad5ebbf420775cc076fba6359f9f26 SOURCE_DATE_EPOCH=1574952268 BUILD_VERSION=v4.2.14 SOURCE_GIT_URL=https://github.com/openshift/cluster-nfd-operator SOURCE_GIT_TAG=fab30b2 BUILD_RELEASE=202001061701
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.description="This is a component of OpenShift and manages the node feature discovery." \
        com.redhat.component="cluster-nfd-operator-container" \
        maintainer="ATS Auto Tuning Scalability  <aos-scalability@redhat.com>" \
        name="openshift/ose-cluster-nfd-operator" \
        com.redhat.delivery.appregistry="false" \
        io.k8s.display-name="OpenShift cluster-nfd-operator" \
        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/fab30b2e11ad5ebbf420775cc076fba6359f9f26" \
        version="v4.2.14" \
        io.openshift.build.commit.id="fab30b2e11ad5ebbf420775cc076fba6359f9f26" \
        release="202001061701" \
        io.openshift.tags="openshift"

