diff --git a/scripts/ci/retag_skipped_image.sh b/scripts/ci/retag_skipped_image.sh index 4f7102e73..d2b39f2c8 100755 --- a/scripts/ci/retag_skipped_image.sh +++ b/scripts/ci/retag_skipped_image.sh @@ -27,7 +27,17 @@ fi SRC_TAG="" for cand in "${CANDIDATES[@]}"; do echo "尝试拉取 ${IMAGE}:${cand} ..." - if docker pull "${IMAGE}:${cand}" >/dev/null 2>&1; then + # 网络抖动容错:每个候选源最多重试 3 次 + pull_ok="" + for try in 1 2 3; do + if docker pull "${IMAGE}:${cand}" >/dev/null 2>&1; then + pull_ok="yes" + break + fi + echo " 拉取失败(第 $try/3 次),2s 后重试..." + sleep 2 + done + if [ -n "$pull_ok" ]; then SRC_TAG="$cand" break fi