Skip to content

Commit

Permalink
add --no-gpg-mirror option
Browse files Browse the repository at this point in the history
This ensures that the GPG key is always downloaded from a trusted source.

Signed-off-by: TianKai Ma <[email protected]>
  • Loading branch information
tiankaima committed Sep 20, 2024
1 parent 4bf098d commit e821323
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ if [ -z "$DOWNLOAD_URL" ]; then
DOWNLOAD_URL=$DEFAULT_DOWNLOAD_URL
fi

if [ -z "GPG_KEY_DOWNLOAD_URL" ]; then
GPG_KEY_DOWNLOAD_URL=$DOWNLOAD_URL
fi

DEFAULT_REPO_FILE="docker-ce.repo"
if [ -z "$REPO_FILE" ]; then
REPO_FILE="$DEFAULT_REPO_FILE"
Expand Down Expand Up @@ -501,7 +505,7 @@ do_install() {
$sh_c 'apt-get -qq update >/dev/null'
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get -y -qq install $pre_reqs >/dev/null"
$sh_c 'install -m 0755 -d /etc/apt/keyrings'
$sh_c "curl -fsSL \"$DOWNLOAD_URL/linux/$lsb_dist/gpg\" -o /etc/apt/keyrings/docker.asc"
$sh_c "curl -fsSL \"GPG_KEY_DOWNLOAD_URL/linux/$lsb_dist/gpg\" -o /etc/apt/keyrings/docker.asc"
$sh_c "chmod a+r /etc/apt/keyrings/docker.asc"
$sh_c "echo \"$apt_repo\" > /etc/apt/sources.list.d/docker.list"
$sh_c 'apt-get -qq update >/dev/null'
Expand Down

0 comments on commit e821323

Please sign in to comment.