Files
AIRegulation-Deployment/scripts/02_pull_images.sh
2026-04-23 09:58:47 +08:00

47 lines
1.6 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# ══════════════════════════════════════════════════
# 02_pull_images.sh
# 预拉取所有 Docker 镜像(离线/弱网环境准备)
# 用法bash scripts/02_pull_images.sh
# ══════════════════════════════════════════════════
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
cd "$PROJECT_DIR"
BLUE='\033[0;34m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; NC='\033[0m'
info() { echo -e "${BLUE}[INFO]${NC} $*"; }
ok() { echo -e "${GREEN}[OK]${NC} $*"; }
# 所有基础镜像列表
IMAGES=(
"pgvector/pgvector:pg16"
"redis:7-alpine"
"quay.io/coreos/etcd:v3.5.5"
"minio/minio:RELEASE.2023-03-13T19-46-17Z"
"milvusdb/milvus:v2.4.13"
"neo4j:5.20-community"
"nginx:1.25-alpine"
"grafana/grafana:11.0.0"
"prom/prometheus:v2.51.0"
)
info "开始拉取 ${#IMAGES[@]} 个基础镜像..."
echo ""
for img in "${IMAGES[@]}"; do
info "拉取:$img"
docker pull "$img"
ok "完成:$img"
echo ""
done
info "所有基础镜像拉取完成"
echo ""
info "自定义服务镜像embedding/mcp/backend将在 build 时自动拉取基础层"
echo ""
echo -e "${YELLOW}提示:如在国内网络环境下 quay.io 或 milvusdb 拉取慢,${NC}"
echo -e "${YELLOW}可配置 Docker 镜像加速器:/etc/docker/daemon.json${NC}"
echo ' {"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]}'