Skip to content

Commit

Permalink
Add Dockerfile.rhel8
Browse files Browse the repository at this point in the history
A separate file is required, as the changes necessary for building with
RHEL 8 content are not compatible with RHEL 7.
  • Loading branch information
yselkowitz committed Jul 21, 2020
1 parent 9bfd3ea commit 71573a7
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions Dockerfile.rhel8
@@ -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

0 comments on commit 71573a7

Please sign in to comment.