From ce4b2cb51f78c29dfbb75c33e5f902fd04630a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Mon, 31 Mar 2025 17:23:44 +0200 Subject: [PATCH] install: Default to staging repo file for staging download URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using a staging download URL (containing "-stage" in the URL), and no explicit repo was provided automatically use the staging repo file as well. So it's sufficient to do: ``` curl -L get.docker.com | DOWNLOAD_URL="https://download-stage.docker.com" sh - ``` instead of ``` curl -L get.docker.com | REPO_FILE="docker-ce-staging.repo" DOWNLOAD_URL="https://download-stage.docker.com" sh - ``` Signed-off-by: Paweł Gronowski --- install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install.sh b/install.sh index 3219205..8c96ddb 100755 --- a/install.sh +++ b/install.sh @@ -101,6 +101,11 @@ fi DEFAULT_REPO_FILE="docker-ce.repo" if [ -z "$REPO_FILE" ]; then REPO_FILE="$DEFAULT_REPO_FILE" + # Automatically default to a staging repo fora + # a staging download url (download-stage.docker.com) + case "$DOWNLOAD_URL" in + *-stage*) REPO_FILE="docker-ce-staging.repo";; + esac fi mirror=''