fix: docker下载URL选择

pull/644/head
gjmzj 2019-07-15 19:39:36 +08:00
parent ebf21b8af6
commit 1e752e4b67
1 changed files with 6 additions and 1 deletions

View File

@ -24,8 +24,13 @@ function install_docker() {
# check if a container runtime is already installed
systemctl status docker|grep Active|grep -q running && { echo "[WARN] docker is already running."; return 0; }
systemctl status containerd|grep Active|grep -q running && { echo "[ERROR] containerd is running, unsupported."; exit 1; }
if [[ "$REGISTRY_MIRROR" == CN ]];then
DOCKER_URL="https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/static/stable/x86_64/docker-${DOCKER_VER}.tgz"
else
DOCKER_URL="https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VER}.tgz"
fi
DOCKER_URL=https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/static/stable/x86_64/docker-${DOCKER_VER}.tgz
mkdir -p /opt/kube/bin /etc/docker /etc/ansible/down
if [[ -f "/etc/ansible/down/docker-${DOCKER_VER}.tgz" ]];then
echo "[INFO] docker binaries already existed"