Skip to content

Commit c0a0c4b

Browse files
committed
add GPG_KEY_DOWNLOAD_URL env
This allows user to choose where to download the gpg key from, original source (default) or a trusted mirror site. Signed-off-by: Tiankai Ma <[email protected]>
1 parent 4bf098d commit c0a0c4b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

install.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ if [ -z "$DOWNLOAD_URL" ]; then
9898
DOWNLOAD_URL=$DEFAULT_DOWNLOAD_URL
9999
fi
100100

101+
if [ -z "GPG_KEY_DOWNLOAD_URL" ]; then
102+
GPG_KEY_DOWNLOAD_URL=$DOWNLOAD_URL
103+
fi
104+
101105
DEFAULT_REPO_FILE="docker-ce.repo"
102106
if [ -z "$REPO_FILE" ]; then
103107
REPO_FILE="$DEFAULT_REPO_FILE"
@@ -501,7 +505,7 @@ do_install() {
501505
$sh_c 'apt-get -qq update >/dev/null'
502506
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get -y -qq install $pre_reqs >/dev/null"
503507
$sh_c 'install -m 0755 -d /etc/apt/keyrings'
504-
$sh_c "curl -fsSL \"$DOWNLOAD_URL/linux/$lsb_dist/gpg\" -o /etc/apt/keyrings/docker.asc"
508+
$sh_c "curl -fsSL \"GPG_KEY_DOWNLOAD_URL/linux/$lsb_dist/gpg\" -o /etc/apt/keyrings/docker.asc"
505509
$sh_c "chmod a+r /etc/apt/keyrings/docker.asc"
506510
$sh_c "echo \"$apt_repo\" > /etc/apt/sources.list.d/docker.list"
507511
$sh_c 'apt-get -qq update >/dev/null'

0 commit comments

Comments
 (0)