From 16d9c02e73d160eac46a923f930c20fc00a03ff3 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Tue, 14 Apr 2026 10:31:01 +0200 Subject: [PATCH] fix(install): use Rocky Linux RHEL Docker repository Add a Rocky-specific Docker install path to the stable and nightly install scripts, using Docker's documented RHEL repository flow. Include a unit test to lock in the Rocky repo selection and command set. --- other/nightly/install.sh | 16 +++++++++++ scripts/install.sh | 16 +++++++++++ .../Unit/InstallScriptRockyDockerRepoTest.php | 28 +++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 tests/Unit/InstallScriptRockyDockerRepoTest.php diff --git a/other/nightly/install.sh b/other/nightly/install.sh index 09406118c..4a91f7b1b 100755 --- a/other/nightly/install.sh +++ b/other/nightly/install.sh @@ -539,6 +539,15 @@ install_docker_manually() { echo "Docker installed successfully." fi } + +install_docker_from_rhel_repo() { + echo " - Installing Docker from the RHEL repository for Rocky Linux..." + rm -f /etc/yum.repos.d/docker-ce.repo /etc/yum.repos.d/docker-ce-staging.repo + dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo + dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + systemctl --now enable docker +} + log_section "Step 3/9: Checking Docker installation" echo "3/9 Checking Docker installation..." if ! [ -x "$(command -v docker)" ]; then @@ -579,6 +588,13 @@ if ! [ -x "$(command -v docker)" ]; then exit 1 fi ;; + "rocky") + install_docker_from_rhel_repo + if ! [ -x "$(command -v docker)" ]; then + echo " - Docker could not be installed automatically. Please visit https://docs.docker.com/engine/install/ and install Docker manually to continue." + exit 1 + fi + ;; "almalinux" | "tencentos") dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo >/dev/null 2>&1 dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin >/dev/null 2>&1 diff --git a/scripts/install.sh b/scripts/install.sh index 2e1dab326..15f172f6d 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -539,6 +539,15 @@ install_docker_manually() { echo "Docker installed successfully." fi } + +install_docker_from_rhel_repo() { + echo " - Installing Docker from the RHEL repository for Rocky Linux..." + rm -f /etc/yum.repos.d/docker-ce.repo /etc/yum.repos.d/docker-ce-staging.repo + dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo + dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + systemctl --now enable docker +} + log_section "Step 3/9: Checking Docker installation" echo "3/9 Checking Docker installation..." if ! [ -x "$(command -v docker)" ]; then @@ -579,6 +588,13 @@ if ! [ -x "$(command -v docker)" ]; then exit 1 fi ;; + "rocky") + install_docker_from_rhel_repo + if ! [ -x "$(command -v docker)" ]; then + echo " - Docker could not be installed automatically. Please visit https://docs.docker.com/engine/install/ and install Docker manually to continue." + exit 1 + fi + ;; "almalinux" | "tencentos") dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo >/dev/null 2>&1 dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin >/dev/null 2>&1 diff --git a/tests/Unit/InstallScriptRockyDockerRepoTest.php b/tests/Unit/InstallScriptRockyDockerRepoTest.php new file mode 100644 index 000000000..da1aa6c5e --- /dev/null +++ b/tests/Unit/InstallScriptRockyDockerRepoTest.php @@ -0,0 +1,28 @@ +toContain('install_docker_from_rhel_repo() {') + ->toContain('echo " - Installing Docker from the RHEL repository for Rocky Linux..."') + ->toContain('rm -f /etc/yum.repos.d/docker-ce.repo /etc/yum.repos.d/docker-ce-staging.repo') + ->toContain('dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo') + ->toContain('dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin') + ->toContain('systemctl --now enable docker') + ->toContain('"rocky")') + ->toContain('install_docker_from_rhel_repo') + ->not->toContain('dnf -y -q --setopt=install_weak_deps=False install dnf-plugins-core') + ->not->toContain('dnf5 config-manager addrepo --overwrite --save-filename=docker-ce.repo --from-repofile=https://download.docker.com/linux/rhel/docker-ce.repo') + ->not->toContain('dnf makecache') + ->not->toContain('"ubuntu" | "debian" | "raspbian" | "centos" | "fedora" | "rhel" | "rocky" | "sles")'); +} + +it('uses the rocky linux documented docker install flow in the stable install script', function () { + expectRockyInstallScriptToUseRhelRepo('scripts/install.sh'); +}); + +it('uses the rocky linux documented docker install flow in the nightly install script', function () { + expectRockyInstallScriptToUseRhelRepo('other/nightly/install.sh'); +});