From 2beddafb5cb71cdb95142feb212da7a19d6c3af6 Mon Sep 17 00:00:00 2001 From: MEHDI AICHOUNI Date: Thu, 24 Oct 2024 17:57:43 +0200 Subject: [PATCH 1/2] feat: move from ubi to ubi-minimal Signed-off-by: MEHDI AICHOUNI --- build/Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 148a035cdd..a80b47b6dd 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -19,7 +19,7 @@ RUN make tidy-vendor format RUN make build -FROM registry.access.redhat.com/ubi9:latest +FROM registry.access.redhat.com/ubi9/ubi-minimal:latest # NOTE: use bash instead of sh SHELL ["/bin/bash", "-c"] @@ -32,20 +32,20 @@ ENV NVIDIA_DRIVER_CAPABILITIES=utility ENV NVIDIA_MIG_MONITOR_DEVICES=all ENV NVIDIA_MIG_CONFIG_DEVICES=all -RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && yum clean all +RUN microdnf clean all && microdnf upgrade -y --refresh --best --nodocs --noplugins --setopt=install_weak_deps=0 && microdnf clean all # NOTE: set -e ensure all fails results in a non-zero exit code (i.e. fail) RUN set -e -x ;\ INSTALL_PKGS=" \ libbpf \ " ;\ - yum install -y $INSTALL_PKGS ;\ + microdnf install -y $INSTALL_PKGS ;\ \ if [[ "$TARGETARCH" == "amd64" ]]; then \ - yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm; \ - yum install -y cpuid; \ + microdnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm; \ + microdnf install -y cpuid; \ if [[ "$INSTALL_DCGM" == "true" ]]; then \ - dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo; \ - yum install -y datacenter-gpu-manager libnvidia-ml; \ + curl https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo -o /etc/yum.repos.d/cuda-rhel9.repo; \ + microdnf install -y datacenter-gpu-manager libnvidia-ml; \ fi; \ if [[ "$INSTALL_HABANA" == "true" ]]; then \ rpm -Uvh https://vault.habana.ai/artifactory/rhel/9/9.2/habanalabs-firmware-tools-1.15.1-15.el9.x86_64.rpm --nodeps; \ @@ -53,7 +53,7 @@ RUN set -e -x ;\ ldconfig; \ fi; \ fi;\ - yum clean all + microdnf clean all COPY --from=builder /workspace/_output/bin/kepler /usr/bin/kepler COPY --from=builder /libbpf-source/linux-5.14.0-424.el9/tools/bpf/bpftool/bpftool /usr/bin/bpftool From 6a968cd3b143f48e898c8c6bc690c234240c4df3 Mon Sep 17 00:00:00 2001 From: MEHDI AICHOUNI Date: Mon, 28 Oct 2024 19:03:36 +0100 Subject: [PATCH 2/2] fix: epel-release installation via rpm Signed-off-by: MEHDI AICHOUNI --- build/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Dockerfile b/build/Dockerfile index a80b47b6dd..96f5321ea4 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -41,7 +41,7 @@ RUN set -e -x ;\ microdnf install -y $INSTALL_PKGS ;\ \ if [[ "$TARGETARCH" == "amd64" ]]; then \ - microdnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm; \ + rpm -i https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm; \ microdnf install -y cpuid; \ if [[ "$INSTALL_DCGM" == "true" ]]; then \ curl https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo -o /etc/yum.repos.d/cuda-rhel9.repo; \