From 567fc2c18044bbee15809c2ef12467d12d700b06 Mon Sep 17 00:00:00 2001 From: hermes-bot Date: Thu, 4 Jun 2026 12:25:28 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=A2=9E=E5=8A=A0=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E5=90=8C=E6=AD=A5=E5=88=B0=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=20registry=20=E7=9A=84=E6=93=8D=E4=BD=9C=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AI/tokyo-proxy/01-proxy.md | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/AI/tokyo-proxy/01-proxy.md b/AI/tokyo-proxy/01-proxy.md index 75fba00..fd58026 100644 --- a/AI/tokyo-proxy/01-proxy.md +++ b/AI/tokyo-proxy/01-proxy.md @@ -99,6 +99,53 @@ git clone https://github.com/torvalds/linux --- +## 外部镜像同步到本地 Registry + +### 场景 +东京服务器能访问 `ghcr.io`/`docker.io`,需要同步到本地 `localhost:5000` registry,供国内 K8s 节点拉取。 + +### 拉取外部镜像 +```bash +docker pull ghcr.io/volcengine/openviking:latest +``` + +### 同步到本地 Registry(推荐保留原始路径) +```bash +# 打 tag,路径保留原始仓库路径 +docker tag ghcr.io/volcengine/openviking:latest localhost:5000/ghcr.io/volcengine/openviking:latest + +# 推送 +docker push localhost:5000/ghcr.io/volcengine/openviking:latest +``` + +### 国内 K8s 节点拉取 +```bash +docker pull 43.130.228.226:5000/ghcr.io/volcengine/openviking:latest +``` + +### 用 skopeo 跳过本地存储直接同步(多架构镜像推荐) +```bash +apt update && apt install -y skopeo + +skopeo copy --dest-tls-verify=false \ + docker://ghcr.io/volcengine/openviking:latest \ + docker://localhost:5000/ghcr.io/volcengine/openviking:latest +``` + +### 查看本地 Registry 内容 +```bash +curl -s http://localhost:5000/v2/_catalog +curl -s http://localhost:5000/v2/ghcr.io/volcengine/openviking/tags/list +``` + +### 路径说明 +- `localhost:5000/library/alpine` = Docker 官方镜像路径 +- `localhost:5000/ghcr.io/volcengine/openviking` = 保留原始来源路径(推荐) + +保留原始路径好处:一目了然知道镜像来源。 + +--- + ## 注意事项 - 东京服务器带宽低(1-2Mbps),Docker 拉大镜像较慢 - Git 流量小,代理无压力