FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=e57c108a91c48296c095ae19e006a37166a9684e SOURCE_GIT_TAG=e57c108 SOURCE_GIT_URL=https://github.com/openshift/cluster-nfd-operator SOURCE_DATE_EPOCH=1581734266 BUILD_VERSION=v4.2.20 BUILD_RELEASE=202002171604
WORKDIR /go/src/github.com/openshift/cluster-nfd-operator
COPY . .
RUN make build

FROM openshift/ose-base:v4.2.20.20200217.160430
ENV SOURCE_GIT_COMMIT=e57c108a91c48296c095ae19e006a37166a9684e SOURCE_GIT_TAG=e57c108 SOURCE_GIT_URL=https://github.com/openshift/cluster-nfd-operator SOURCE_DATE_EPOCH=1581734266 BUILD_VERSION=v4.2.20 BUILD_RELEASE=202002171604
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" \
        version="v4.2.20" \
        release="202002171604" \
        io.openshift.build.commit.id="e57c108a91c48296c095ae19e006a37166a9684e" \
        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/e57c108a91c48296c095ae19e006a37166a9684e"

