FROM openshift/golang-builder:1.10 AS builder
ENV SOURCE_GIT_COMMIT=7b193ad351cb4a5f9bc57325ec8fb912b7d17732 SOURCE_GIT_TAG=7b193ad SOURCE_DATE_EPOCH=1559657723
WORKDIR /go/src/github.com/openshift/cluster-node-tuning-operator
COPY . .
RUN make build

FROM openshift/ose-base:v4.1.1-201906040019
ENV SOURCE_GIT_COMMIT=7b193ad351cb4a5f9bc57325ec8fb912b7d17732 SOURCE_GIT_TAG=7b193ad SOURCE_DATE_EPOCH=1559657723
COPY --from=builder /go/src/github.com/openshift/cluster-node-tuning-operator/cluster-node-tuning-operator /usr/bin/
COPY manifests /manifests
RUN useradd cluster-node-tuning-operator
USER cluster-node-tuning-operator
ENTRYPOINT ["/usr/bin/cluster-node-tuning-operator"]

LABEL \
        io.k8s.description="This is a component of OpenShift and manages the lifecycle of node-level tuning." \
        com.redhat.component="cluster-node-tuning-operator-container" \
        name="openshift/ose-cluster-node-tuning-operator" \
        io.k8s.display-name="OpenShift cluster-node-tuning-operator" \
        io.openshift.build.source-location="https://github.com/openshift/cluster-node-tuning-operator" \
        io.openshift.release.operator="true" \
        io.openshift.build.commit.url="https://github.com/openshift/cluster-node-tuning-operator/commit/7b193ad351cb4a5f9bc57325ec8fb912b7d17732" \
        version="v4.1.1" \
        io.openshift.build.commit.id="7b193ad351cb4a5f9bc57325ec8fb912b7d17732" \
        release="201906041044"

