diff --git a/Dockerfile--rockylinux_10.tmpl b/Dockerfile--rockylinux_10.tmpl index ed1d068..4a3de07 100644 --- a/Dockerfile--rockylinux_10.tmpl +++ b/Dockerfile--rockylinux_10.tmpl @@ -9,6 +9,10 @@ ARG PYTHON_VERSION=3 # --------------------------------------------- base1 FROM rockylinux/rockylinux:10 AS base1 +# STEP 1: Fix the root cause (unstable mirrors). Switch to the official CDN. +RUN sed -i 's/mirrorlist=/ #mirrorlist=/g' /etc/yum.repos.d/rocky*.repo && \ + sed -i 's/#baseurl=http:\/\/dl.rockylinux.org/baseurl=https:\/\/dl.rockylinux.org/g' /etc/yum.repos.d/rocky*.repo + # In RHEL 9/10, the repository for dev packages is called CRB (instead of powertools) RUN dnf install -y 'dnf-command(config-manager)' && \ dnf config-manager --set-enabled crb diff --git a/Dockerfile--rockylinux_9.tmpl b/Dockerfile--rockylinux_9.tmpl index 88b0559..1089173 100644 --- a/Dockerfile--rockylinux_9.tmpl +++ b/Dockerfile--rockylinux_9.tmpl @@ -40,6 +40,10 @@ RUN /usr/libexec/openssh/sshd-keygen rsa && \ # --------------------------------------------- base2_with_python-3 FROM base1 AS base2_with_python-3 +# STEP 1: Fix the root cause (unstable mirrors). Switch to the official CDN. +RUN sed -i 's/mirrorlist=/ #mirrorlist=/g' /etc/yum.repos.d/rocky*.repo && \ + sed -i 's/#baseurl=http:\/\/dl.rockylinux.org/baseurl=https:\/\/dl.rockylinux.org/g' /etc/yum.repos.d/rocky*.repo + # Rocky 9/10 installs python3.9 or higher (depending on the repository) RUN dnf install -y --setopt=retries=10 --setopt=max_parallel_downloads=10 --allowerasing \ python3 \