Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A separate file is required, as the changes necessary for building with RHEL 8 content are not compatible with RHEL 7.
- Loading branch information
1 parent
9bfd3ea
commit 71573a7
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.14 AS builder | ||
WORKDIR /go/src/github.com/openshift/cluster-node-tuning-operator | ||
COPY . . | ||
RUN make build | ||
|
||
FROM registry.svc.ci.openshift.org/ocp/4.6:base AS tuned | ||
WORKDIR /root | ||
COPY assets/tuned /root | ||
RUN INSTALL_PKGS=" \ | ||
git rpm-build make desktop-file-utils patch \ | ||
python3 python3-configobj python3-pyudev \ | ||
" && \ | ||
yum install --setopt=tsflags=nodocs -y $INSTALL_PKGS && \ | ||
cd daemon && \ | ||
LC_COLLATE=C cat ../patches/*.diff | patch -Np1 && \ | ||
make rpm PYTHON=/usr/bin/python3 && \ | ||
rm -rf /root/rpmbuild/RPMS/noarch/{tuned-gtk*,tuned-utils*,tuned-profiles-compat*,tuned-profiles-nfv*} | ||
|
||
FROM registry.svc.ci.openshift.org/ocp/4.6:base | ||
COPY --from=builder /go/src/github.com/openshift/cluster-node-tuning-operator/_output/cluster-node-tuning-operator /usr/bin/ | ||
COPY manifests /manifests | ||
ENV APP_ROOT=/var/lib/tuned | ||
ENV PATH=${APP_ROOT}/bin:${PATH} | ||
ENV HOME=${APP_ROOT} | ||
WORKDIR ${APP_ROOT} | ||
COPY --from=builder /go/src/github.com/openshift/cluster-node-tuning-operator/_output/openshift-tuned /usr/bin/ | ||
COPY --from=builder /go/src/github.com/openshift/cluster-node-tuning-operator/assets ${APP_ROOT} | ||
COPY --from=tuned /root/rpmbuild/RPMS/noarch /root/rpms | ||
RUN INSTALL_PKGS=" \ | ||
hdparm kernel-tools tuna socat \ | ||
" && \ | ||
mkdir -p /etc/grub.d/ /boot && \ | ||
yum install --setopt=tsflags=nodocs -y $INSTALL_PKGS && \ | ||
rpm -V $INSTALL_PKGS && \ | ||
yum --setopt=tsflags=nodocs -y install /root/rpms/*.rpm && \ | ||
touch /etc/sysctl.conf && \ | ||
yum clean all && \ | ||
rm -rf /var/cache/yum ~/patches /root/rpms && \ | ||
useradd -r -u 499 cluster-node-tuning-operator | ||
ENTRYPOINT ["/usr/bin/cluster-node-tuning-operator"] | ||
LABEL io.k8s.display-name="OpenShift cluster-node-tuning-operator" \ | ||
io.k8s.description="This is a component of OpenShift and manages the lifecycle of node-level tuning." \ | ||
io.openshift.release.operator=true |