From 2e79f0c54a75c64ff5bc9d33e6df7f25831d4920 Mon Sep 17 00:00:00 2001 From: Liz Zhang Date: Thu, 29 Sep 2016 14:07:51 +0800 Subject: [PATCH] Use the mirror in China for Azure China environment Signed-off-by: Liz Zhang Use the mirror in China for Azure China environment Signed-off-by: Liz Zhang Update option name to --mirror Signed-off-by: Liz Zhang Update indent and change variable name Signed-off-by: Liz Zhang Upstream-commit: 451979a368c0fcb7990bcce82122609a7b412428 Component: engine --- components/engine/hack/install.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/components/engine/hack/install.sh b/components/engine/hack/install.sh index b054869a70..5da3ab5b21 100644 --- a/components/engine/hack/install.sh +++ b/components/engine/hack/install.sh @@ -34,6 +34,27 @@ pgp.mit.edu keyserver.ubuntu.com " +mirror='' +while [ $# -gt 0 ]; do + case "$1" in + --mirror) + mirror="$2" + shift + ;; + *) + echo "Illegal option $1" + ;; + esac + shift $(( $# > 0 ? 1 : 0 )) +done + +case "$mirror" in + AzureChinaCloud) + apt_url="https://mirror.azure.cn/docker-engine/apt" + yum_url="https://mirror.azure.cn/docker-engine/yum" + ;; +esac + command_exists() { command -v "$@" > /dev/null 2>&1 }