imageName="$project:$tag"
imageName1="$harbor1/$imageName"
docker pull $imageName1
if [ $? -eq 0 ]; then
echo "$imageName1下载正常"
else
harbor1="dockerproxy.com"
imageName1="$harbor1/$imageName"
echo "开始下载$imageName1"
docker pull $imageName1
if [ $? -eq 0 ]; then
echo "$imageName1下载正常"
else
harbor1="docker.nju.edu.cn"
imageName1="$harbor1/$imageName"
echo "开始下载$imageName1"
docker pull $imageName1
if [ $? -eq 0 ]; then
echo "$imageName1下载正常"
else
echo "$imageName1下载不正常,且已经没有多余的镜像站点了。退出。"
exit
fi
fi
fi
harbor1List=("docker.io" "dockerproxy.com" "docker.nju.edu.cn")
for harbor1 in "${harbor1List[@]}"; do
imageName="$project:$tag"
imageName1="$harbor1/$imageName"
echo "开始下载$imageName1"
docker pull "$imageName1"
if [ $? -eq 0 ]; then
echo "下载$imageName1正常"
break
else
echo "下载$imageName1异常"
fi
done