2025 最新 Docker 镜像源加速列表与使用指南(10月更新)
https://zhuanlan.zhihu.com/p/1957125117403439309

12 人赞同了该文章
前言
由于国内大部分高校、云厂商的公共镜像源已逐渐关闭或限用,这里汇总 目前仍可用且稳定的 Docker 镜像加速地址,并提供详细的配置方法(含 Docker、K8s containerd、Podman 等场景),保证即使是零基础用户也能照着完成配置。

⚠️ 说明:本文仅限学习研究,请合理合规使用。建议收藏,随时获取最新更新。
🔍 10 月可用镜像加速源
轩辕镜像
免费版(推荐常规用户):
👉 地址:https://docker.xuanyuan.me
免费使用,无需登录
支持境内 CDN 加速
支持常见 Linux 桌面、服务器、NAS 设备,以及 containerd/Podman 环境
提供官网搜索功能
专业版(会员)(推荐开发者、科研人员、企业及 NAS 用户):
👉 地址:https://xuanyuan.cloud
需登录,速度更稳定,提供专属加速地址(如 xxx.xuanyuan.run)
支持 K8s(k3s/cri-o)、群晖/威联通/极空间 NAS、Podman 等特殊环境
企业级支持,提供售后服务与定制化配置方案
腾讯云镜像
👉 地址:https://mirror.ccs.tencentyun.com

仅推荐在腾讯云服务器上使用(在其他环境可能不可用)。
阿里云镜像
👉 地址:https://xxx.mirror.aliyuncs.com(不同账号地址不同)

仅推荐在阿里云 ECS 环境中使用。
🚀 一键安装与配置镜像加速
方法一:一键安装脚本(快捷使用方式)
适合 全新安装 Docker 或希望 自动配置镜像源 的用户。


bash <(curl -sSL https://xuanyuan.cloud/docker.sh)

💡 提示:

脚本支持自动安装 Docker + Docker Compose
自动配置 轩辕镜像加速源
兼容 Ubuntu、Debian、CentOS 等常见发行版
方法二:手动配置(已有 Docker 环境)
Linux 系统
执行以下命令创建 Docker 配置目录并写入加速配置:


# 创建 Docker 配置目录
sudo mkdir -p /etc/docker

# 写入镜像加速配置到 daemon.json
cat <<EOF | sudo tee /etc/docker/daemon.json
{
  "registry-mirrors": ["https://docker.xuanyuan.me"]
}
EOF

# 重新加载配置并重启 Docker
sudo systemctl daemon-reload
sudo systemctl restart docker
验证配置是否生效:
docker info | grep "Registry Mirrors" -A 3

若输出中包含 https://docker.xuanyuan.me,则配置成功。

macOS(Docker Desktop)
基础配置(使用免费加速源):
点击菜单栏 Docker 图标 → Preferences
找到 Daemon → Registry mirrors
添加地址:https://docker.xuanyuan.me
点击 Apply & Restart
补充配置:使用专属免登录加速地址(轩辕专业版)
若已获取轩辕镜像专业版的专属地址(如 xxx.xuanyuan.run),可优化配置以提升稳定性:
进入 Docker Desktop 设置 → 选择左侧 Docker Engine
在 JSON 配置中添加 insecure-registries(不含 https://)和 registry-mirrors(含 https://):

{
  "insecure-registries": ["xxx.xuanyuan.run"],
  "registry-mirrors": [
    "https://xxx.xuanyuan.run",
    "https://docker.xuanyuan.me" // 保留免费源作为备用
  ]
}

点击 Apply & Restart,重启后通过 docker info 验证配置是否生效。
Windows(Docker Desktop)
基础配置(使用免费加速源):
右下角 Docker 图标 → Settings
打开 Docker Daemon 配置 → 修改 JSON 内容:

{
  "registry-mirrors": ["https://docker.xuanyuan.me"]
}

点击 Apply,等待 Docker 重启完成。
补充配置:使用专属免登录加速地址(轩辕专业版)
打开 Docker Desktop → 进入 Settings → 选择 Docker Engine
按以下格式修改配置(注意 insecure-registries 无协议头):

{
  "insecure-registries": ["xxx.xuanyuan.run"],
  "registry-mirrors": ["https://xxx.xuanyuan.run"]
}

点击 Apply 重启 Docker,通过 docker info 查看 Registry Mirrors 确认生效。
🔧 其他容器环境镜像加速配置
除常规 Docker 外,针对 K8s 集群常用的 containerd 及轻量容器工具 Podman,以下提供专属加速配置方案。

K8s containerd 镜像加速配置
适用于 Kubernetes(k3s/cri-o)或自建 containerd 环境,通过配置专属镜像域名提升拉取速度与可用性。

适用版本
containerd 版本 是否支持本配置格式

< 1.4    不支持(语法差异)
1.4 ~ 1.7.x    完全支持
≥ 1.7.x    推荐使用本格式
查看当前版本:

containerd --version
配置文件路径与初始化
containerd 默认配置文件为:/etc/containerd/config.toml
若系统中未生成该文件,执行以下命令初始化默认配置:

containerd config default > /etc/containerd/config.toml
镜像加速源配置示例
编辑 config.toml 文件(可使用 sudo nano /etc/containerd/config.toml),在 plugins."io.containerd.grpc.v1.cri".registry.mirrors 节点下添加以下内容(使用轩辕专业版专属地址):

[plugins."io.containerd.grpc.v1.cri".registry]
  [plugins."io.containerd.grpc.v1.cri".registry.mirrors]
    # Docker Hub 加速(核心仓库,优先配置)
    [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
      endpoint = ["https://xxx.xuanyuan.run"]
    # K8s 官方镜像加速(k8s.gcr.io,旧版 K8s 镜像仓库)
    [plugins."io.containerd.grpc.v1.cri".registry.mirrors."k8s.gcr.io"]
      endpoint = ["https://xxx-k8s.xuanyuan.run"]
    # GCR 镜像加速(Google 容器仓库,含大量开源镜像)
    [plugins."io.containerd.grpc.v1.cri".registry.mirrors."gcr.io"]
      endpoint = ["https://xxx-gcr.xuanyuan.run"]
    # GHCR 镜像加速(GitHub Container Registry,开发者常用仓库)
    [plugins."io.containerd.grpc.v1.cri".registry.mirrors."ghcr.io"]
      endpoint = ["https://xxx-ghcr.xuanyuan.run"]
扩展配置(针对 http://registry.k8s.io)
部分新版 K8s 镜像迁移至 registry.k8s.io 仓库,需新增如下配置(同样添加至 plugins."io.containerd.grpc.v1.cri".registry.mirrors 节点下):

[plugins."io.containerd.grpc.v1.cri".registry.mirrors."registry.k8s.io"]
  endpoint = ["https://xxx.xuanyuan.run"]
💡 说明:

多个 endpoint 按优先级排列,containerd 会依次尝试直到拉取成功;
若专属地址包含多节点,可在 endpoint 中添加多个地址(如 [“https://node1.xxx.xuanyuan.run", “https://node2.xxx.xuanyuan.run"])。
生效与验证

# 重启 containerd 服务(确保配置生效)
sudo systemctl restart containerd

# 验证方式1:查看 containerd 配置中是否包含加速地址
grep -A 5 "docker.io" /etc/containerd/config.toml

# 验证方式2:拉取测试镜像(观察拉取速度,正常应达 MB 级)
ctr images pull xxx.xuanyuan.run/library/alpine:latest

# 验证方式3:K8s 环境测试(部署 Pod 时自动拉取镜像)
kubectl run test-pod --image=nginx:latest
kubectl describe pod test-pod | grep "Image:"  # 确认镜像拉取来源

Podman 镜像加速配置
适用于 CentOS/Ubuntu/Arch 等系统,支持通过配置专属加速地址提升 Podman 拉取镜像的速度与可控性,兼容 Docker 命令习惯。

适用场景
使用 Podman 替代 Docker 作为容器运行时(无守护进程,更轻量)
需加快从 docker.io、ghcr.io、gcr.io、k8s.gcr.io 等仓库拉取镜像的速度
已获取轩辕镜像专业版专属加速地址(如 xxx.xuanyuan.run)
配置步骤
选择配置文件路径
Podman 镜像仓库配置支持两种方式,推荐方式 2(避免覆盖系统默认配置):
方式 1:直接编辑主配置文件 → sudo nano /etc/containers/registries.conf
方式 2:新增自定义配置文件 → sudo nano /etc/containers/registries.conf.d/custom.conf
添加加速配置内容
在选定的配置文件中写入以下内容(替换 xxx.xuanyuan.run 为实际专属地址):

# 默认搜索 Docker Hub(未指定仓库时,优先从 docker.io 拉取镜像)
unqualified-search-registries = ['docker.io']

# 1. Docker Hub 加速配置(最常用仓库)
[[registry]]
prefix = "docker.io"       # 匹配 docker.io 仓库的所有镜像
insecure = true            # 允许非加密连接(根据加速地址协议调整,HTTPS 可保留 true)
location = "registry-1.docker.io"  # 原始仓库地址(用于 fallback)
  [[registry.mirror]]
  location = "xxx.xuanyuan.run"    # 专属加速地址(优先使用)

# 2. K8s.gcr.io 加速配置(K8s 组件镜像)
[[registry]]
prefix = "k8s.gcr.io"
insecure = true
location = "k8s.gcr.io"
  [[registry.mirror]]
  location = "xxx-k8s.xuanyuan.run"

# 3. GCR.io 加速配置(Google 开源项目镜像,如 TensorFlow)
[[registry]]
prefix = "gcr.io"
insecure = true
location = "gcr.io"
  [[registry.mirror]]
  location = "xxx-gcr.xuanyuan.run"

# 4. GHCR.io 加速配置(GitHub 开发者镜像,如开源工具)
[[registry]]
prefix = "ghcr.io"
insecure = true
location = "ghcr.io"
  [[registry.mirror]]
  location = "xxx-ghcr.xuanyuan.run"
保存配置并测试生效
保存文件(nano 编辑器按 Ctrl+O → 回车 → Ctrl+X)
执行以下命令拉取测试镜像,验证是否走加速地址:
# 拉取基础镜像(Alpine,体积小,测试快)
podman pull docker.io/library/alpine:latest

# 查看镜像详情,确认拉取来源(含加速地址则生效)
podman inspect alpine:latest | grep -i "registry"

# 可选:通过网络工具确认(如 curl 测试加速地址连通性)
curl -I https://xxx.xuanyuan.run/v2/library/alpine/manifests/latest

📦 使用示例:拉取镜像
拉取官方镜像
不同环境下的官方镜像拉取命令示例(以 MySQL、Nginx 为例):

# 1. Docker(免费加速源)
docker pull docker.xuanyuan.me/library/mysql:5.7
docker pull docker.xuanyuan.me/library/nginx:1.25

# 2. Docker(轩辕专业版专属地址)
docker pull xxx.xuanyuan.run/library/mysql:8.0
docker pull xxx.xuanyuan.run/library/nginx:latest

# 3. Podman(配置后自动走加速,无需显式指定加速地址)
podman pull mysql:5.7
podman pull nginx:1.25

# 4. containerd(需显式指定加速地址)
ctr images pull xxx.xuanyuan.run/library/mysql:5.7
ctr images pull xxx-k8s.xuanyuan.run/k8s.gcr.io/pause:3.9  # K8s 基础镜像
拉取用户镜像
用户自定义镜像(如个人/企业上传至 Docker Hub、GHCR 的镜像)拉取示例:

# 1. Docker 拉取 Docker Hub 用户镜像
docker pull xxx.xuanyuan.run/username/my-web-app:v1.0  # username 替换为实际用户名

# 2. Docker 拉取 GHCR 用户镜像(需用 GHCR 专属加速地址)
docker pull xxx-ghcr.xuanyuan.run/username/my-tool:v2.1

# 3. Podman 拉取 GHCR 用户镜像(自动匹配配置的加速地址)
podman pull ghcr.io/username/my-tool:v2.1

# 4. containerd 拉取 GCR 用户镜像
ctr images pull xxx-gcr.xuanyuan.run/google-samples/node-hello:1.0
在 Docker Compose 中使用
配置好系统级加速源后,docker compose 会自动使用加速,无需修改 docker-compose.yml 文件。

示例 docker-compose.yml(部署 Nginx + MySQL 服务):

version: "3.8"
services:
  # Nginx 服务(自动通过加速源拉取 nginx:latest)
  web:
    image: nginx:latest
    ports:
      - "8080:80"  # 宿主机 8080 端口映射到容器 80 端口
    volumes:
      - ./nginx/conf:/etc/nginx/conf.d  # 挂载自定义 Nginx 配置

  # MySQL 服务(自动通过加速源拉取 mysql:8.0)
  db:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: root  # MySQL 根密码(生产环境需改为复杂密码)
      MYSQL_DATABASE: test_db   # 初始化创建的数据库
    volumes:
      - mysql-data:/var/lib/mysql  # 挂载数据卷,持久化 MySQL 数据

# 定义数据卷(避免容器删除后数据丢失)
volumes:
  mysql-data:
运行与停止命令:

# 启动服务(后台运行)
docker compose up -d

# 查看服务状态
docker compose ps

# 停止服务(保留数据卷)
docker compose down

# 停止服务并删除数据卷(谨慎使用)
docker compose down -v
在 containerd/Podman 中使用
containerd 示例(K8s 集群外单独使用)
# 1. 拉取 Nginx 镜像
ctr images pull xxx.xuanyuan.run/library/nginx:latest

# 2. 运行 Nginx 容器(--rm 表示容器停止后自动删除,-t 分配终端)
ctr run --rm -t --net-host xxx.xuanyuan.run/library/nginx:latest nginx-test

# 3. 查看正在运行的容器
ctr containers ls

# 4. 停止容器(nginx-test 为容器名)
ctr tasks stop nginx-test
Podman 示例(模拟 Docker 命令)
Podman 命令与 Docker 高度兼容,可直接替换 docker 为 podman 使用:

# 1. 拉取并运行 Redis 容器(后台运行,端口映射)
podman run -d -p 6379:6379 --name redis-test redis:7.2

# 2. 查看容器运行状态
podman ps

# 3. 进入容器内部(执行命令)
podman exec -it redis-test redis-cli

# 4. 停止并删除容器
podman stop redis-test
podman rm redis-test

# 5. 查看本地镜像列表
podman images
文档更新时间: 2025-10-26 23:07   作者:admin