forked from openshift/cluster-node-tuning-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.rhel7
47 lines (45 loc) · 2 KB
/
Dockerfile.rhel7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.15 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 /root/assets
RUN INSTALL_PKGS=" \
gcc git rpm-build make desktop-file-utils patch \
" && \
yum install --setopt=tsflags=nodocs -y $INSTALL_PKGS && \
cd assets/tuned/daemon && \
LC_COLLATE=C cat ../patches/*.diff | patch -Np1 && \
make rpm PYTHON=/usr/bin/python && \
rm -rf /root/rpmbuild/RPMS/noarch/{tuned-gtk*,tuned-utils*,tuned-profiles-compat*} && \
cd ../stalld && \
make
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=tuned /root/assets ${APP_ROOT}
COPY --from=tuned /root/rpmbuild/RPMS/noarch /root/rpms
RUN INSTALL_PKGS=" \
socat procps-ng \
" && \
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 && \
find /root/rpms -name \*.rpm -exec basename {} .rpm \; | xargs rpm -e --justdb && \
cp -a /var/lib/tuned/tuned/stalld/stalld /usr/local/bin && \
rm -rf /var/lib/tuned/tuned && \
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