From f4e54ce814fdbf67b9a9805df2070f7bc5e7782f Mon Sep 17 00:00:00 2001 From: Patrick Buckley Date: Sat, 11 Jul 2026 18:40:34 -0700 Subject: [PATCH] fix(install): gate get.docker.com by $ID instead of trapping all failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deciding the installer up front — get.docker.com for the IDs it recognizes, Docker's repo directly for unrecognized derivatives — avoids treating a transient get.docker.com failure (network, apt lock, EOL sleep) on a supported distro as an "unsupported distro" and silently routing it into the repo path. Recognized IDs now surface the real failure via die instead of masking it; unrecognized derivatives (Nobara, Mint, …) skip the doomed call and its "Unsupported distribution" output entirely rather than running it to fail. Addresses review feedback on #829. --- run.sh | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/run.sh b/run.sh index 93db49c9..f670c18b 100755 --- a/run.sh +++ b/run.sh @@ -186,15 +186,32 @@ install_docker_ce_repo() { esac } +# The distro IDs get.docker.com installs directly: it matches $ID against this +# exact set (ignoring ID_LIKE) and aborts on anything else. Mirrors the dispatch +# in get.docker.com, including its fedora-asahi-remix -> fedora alias. +get_docker_com_supports() { + case "$1" in + ubuntu|debian|raspbian|centos|fedora|rhel|rocky|sles|fedora-asahi-remix) return 0 ;; + *) return 1 ;; + esac +} + install_docker() { case "$PKG" in apt|dnf|yum) - info "Installing Docker via the official get.docker.com script" - # get.docker.com aborts on distros it doesn't recognize by $ID; when it - # does, add Docker's repo for the family we detected instead. - if ! curl -fsSL https://get.docker.com | $SUDO sh; then - warn "get.docker.com doesn't recognize '${OS_ID:-this distro}' — using Docker's repository directly." + # Decide up front which installer applies, rather than treating every + # get.docker.com failure as "unsupported distro": for an ID it knows, + # let it run and surface any real failure (network, apt lock, EOL) via + # die instead of masking it with the repo path. Only unrecognized + # derivatives (Nobara, Mint, …) — which it would just abort on — skip + # straight to adding Docker's repo ourselves. + if [ -n "$OS_ID" ] && ! get_docker_com_supports "$OS_ID"; then + info "get.docker.com doesn't support '$OS_ID' — using Docker's official repository directly." install_docker_ce_repo + else + info "Installing Docker via the official get.docker.com script" + curl -fsSL https://get.docker.com | $SUDO sh \ + || die "get.docker.com failed to install Docker (see the output above). Fix the issue and re-run — the script resumes." fi ;; pacman)