本文汇总了当前可用且稳定的 Docker 镜像加速地址,覆盖 Docker、K8s containerd、Podman 等主流场景,零基础用户也能按步骤完成配置。
⚠️ 说明:本文内容仅限学习研究,请勿违规使用。建议收藏,以便获取后续更新。
2025年11月可用镜像加速源
1. 腾讯云镜像
- 地址:https://mirror.ccs.tencentyun.com
- 仅推荐在腾讯云服务器上使用,其他环境可能无法正常访问
2. 阿里云镜像
- 地址:https://xxx.mirror.aliyuncs.com(不同账号专属地址不同)
- 仅推荐在阿里云 ECS 环境中使用,需配合自身账号配置
3. 轩辕镜像(推荐优先使用)
- 免费版(适合常规用户)
- 地址:https://docker.xuanyuan.me
- 无需登录,免费使用
- 境内 CDN 加速,访问稳定
- 兼容 Linux 桌面/服务器/NAS 设备,支持 containerd、Podman 环境
- 提供官网搜索功能,方便查找镜像
- 专业版(适合开发者、科研人员、企业及 NAS 用户)
- 地址:https://xuanyuan.cloud
- 需登录,提供专属加速地址(如 xxx.xuanyuan.run),速度更稳定
- 支持 K8s(k3s/cri-o)、群晖/威联通/极空间 NAS 等特殊环境
- 提供企业级支持、售后服务及定制化配置方案
一键安装与配置镜像加速(推荐方案)
Linux Docker & Docker Compose 一键安装配置脚本
脚本支持 13 种主流 Linux 发行版(含国产系统),可一键完成 Docker、Docker Compose 安装及轩辕镜像加速配置,无需手动操作。
执行命令
bash <(wget -qO- https://xuanyuan.cloud/docker.sh)
脚本特性与优势
- 支持 13 种发行版:覆盖 openEuler、OpenCloudOS、Anolis OS、Alinux、Kylin Linux 等国产系统,以及 Fedora、Rocky Linux、Ubuntu、Debian、CentOS 等主流发行版
- 国产系统深度适配:自动识别国产操作系统版本,提供最优配置方案
- 多源智能切换:内置阿里云、腾讯云、华为云、中科大、清华等 6+ 国内镜像源,自动选择最快节点
- 老版本兼容:支持 Ubuntu 16.04、Debian 9/10 等过期系统,自动适配兼容安装方案
- 双重安装保障:包管理器安装失败时,自动切换到二进制安装,确保安装成功
- 跨系统提示:检测到 macOS 或 Windows 系统时,自动提供 Docker Desktop 安装指引
- 开源透明:脚本已在 GitHub 开源,可查看源码确认安全性
支持的操作系统详情
| 国产操作系统 | openEuler (欧拉) | 20.03+, 22.03+, 24.03+ | ✅ | 华为开源,兼容 CentOS |
| OpenCloudOS | 9.x | ✅ | 腾讯开源,兼容 CentOS 9 | |
| Anolis OS (龙蜥) | 7.x, 8.x | ✅ | 阿里云支持,兼容 RHEL | |
| Alinux (阿里云) | 2.x, 3.x | ✅ | 阿里云 ECS 默认系统 | |
| Kylin Linux (银河麒麟) | V10 | ✅ | 国产系统,兼容 RHEL | |
| CentOS 替代品 | Rocky Linux | 8.x, 9.x | ✅ | 10年支持周期,兼容 RHEL |
| AlmaLinux | 8.x, 9.x | ✅ | 10年支持周期,兼容 RHEL | |
| 创新发行版 | Fedora | 34+ | ✅ | Red Hat 上游,含最新特性 |
| 传统发行版 | Ubuntu | 16.04+ | ✅ | 含老版本特殊兼容处理 |
| Debian | 9+ | ✅ | 含老版本特殊兼容处理 | |
| CentOS | 7, 8, 9 | ✅ | 包含 Stream 版本 | |
| RHEL | 7, 8, 9 | ✅ | Red Hat 企业级发行版 | |
| Oracle Linux | 7, 8, 9 | ✅ | Oracle 企业级发行版 |
💡 提示:脚本会自动检测系统类型和版本,无需手动选择安装方案,全程自动化完成。
手动配置镜像加速(已安装 Docker 环境)
Linux 系统
# 创建配置目录
sudo mkdir -p /etc/docker
# 写入加速配置
cat <<EOF | sudo tee /etc/docker/daemon.json
{
"registry-mirrors": ["https://docker.xuanyuan.me"]
}
EOF
# 重新加载配置并重启 Docker
sudo systemctl daemon-reload
sudo systemctl restart docker
macOS(Docker Desktop)
基础配置(免费加速源)
补充配置(轩辕专业版专属地址)
{
"insecure-registries": ["xxx.xuanyuan.run"],
"registry-mirrors": ["https://xxx.xuanyuan.run", "https://docker.xuanyuan.me"]
}
Windows(Docker Desktop)
基础配置(免费加速源)
{
"registry-mirrors": ["https://docker.xuanyuan.me"]
}
补充配置(轩辕专业版专属地址)
{
"insecure-registries": ["xxx.xuanyuan.run"],
"registry-mirrors": ["https://xxx.xuanyuan.run"]
}
其他容器环境加速配置
K8s containerd 镜像加速配置
适用于 Kubernetes(k3s/cri-o)或自建 containerd 环境,提升镜像拉取速度。
适用版本
| < 1.4 | 不支持(语法差异) |
| 1.4 ~ 1.7.x | 完全支持 |
| ≥ 1.7.x | 推荐使用 |
查看当前版本:containerd –version
配置步骤
containerd config default > /etc/containerd/config.toml
[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)
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."k8s.gcr.io"]
endpoint = ["https://xxx-k8s.xuanyuan.run"]
# GCR 镜像仓库
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."gcr.io"]
endpoint = ["https://xxx-gcr.xuanyuan.run"]
# GHCR 镜像仓库
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."ghcr.io"]
endpoint = ["https://xxx-ghcr.xuanyuan.run"]
# 新版 K8s 镜像仓库(registry.k8s.io)
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."registry.k8s.io"]
endpoint = ["https://xxx.xuanyuan.run"]
生效与验证
# 重启 containerd
sudo systemctl restart containerd
# 验证配置
grep -A 5 "docker.io" /etc/containerd/config.toml
# 拉取测试镜像
ctr images pull xxx.xuanyuan.run/library/alpine:latest
# K8s 环境测试
kubectl run test-pod –image=nginx:latest
kubectl describe pod test-pod | grep "Image:"
Podman 镜像加速配置
适用于无守护进程的轻量场景,兼容 Docker 命令习惯。
配置步骤
sudo nano /etc/containers/registries.conf.d/custom.conf
# 默认搜索 Docker Hub
unqualified-search-registries = ['docker.io']
# Docker Hub 加速
[[registry]]
prefix = "docker.io"
insecure = true
location = "registry-1.docker.io"
[[registry.mirror]]
location = "xxx.xuanyuan.run"
# K8s.gcr.io 加速
[[registry]]
prefix = "k8s.gcr.io"
insecure = true
location = "k8s.gcr.io"
[[registry.mirror]]
location = "xxx-k8s.xuanyuan.run"
# GCR.io 加速
[[registry]]
prefix = "gcr.io"
insecure = true
location = "gcr.io"
[[registry.mirror]]
location = "xxx-gcr.xuanyuan.run"
# GHCR.io 加速
[[registry]]
prefix = "ghcr.io"
insecure = true
location = "ghcr.io"
[[registry.mirror]]
location = "xxx-ghcr.xuanyuan.run"
验证生效
# 拉取测试镜像
podman pull docker.io/library/alpine:latest
# 查看镜像拉取来源
podman inspect alpine:latest | grep -i "registry"
镜像拉取使用示例
拉取官方镜像
# Docker(免费源)
docker pull docker.xuanyuan.me/library/mysql:5.7
docker pull docker.xuanyuan.me/library/nginx:1.25
# Docker(轩辕镜像专业版专属地址)
docker pull xxx.xuanyuan.run/library/mysql:8.0
docker pull xxx.xuanyuan.run/library/nginx:latest
# Podman(自动走加速)
podman pull mysql:5.7
podman pull nginx:1.25
# containerd(显式指定加速地址)
ctr images pull xxx.xuanyuan.run/library/mysql:5.7
ctr images pull xxx-k8s.xuanyuan.run/k8s.gcr.io/pause:3.9
拉取用户自定义镜像
# Docker 拉取 Docker Hub 用户镜像
docker pull xxx.xuanyuan.run/username/my-web-app:v1.0
# Docker 拉取 GHCR 用户镜像
docker pull xxx-ghcr.xuanyuan.run/username/my-tool:v2.1
# Podman 拉取 GHCR 用户镜像
podman pull ghcr.io/username/my-tool:v2.1
# containerd 拉取 GCR 用户镜像
ctr images pull xxx-gcr.xuanyuan.run/google-samples/node-hello:1.0
Docker Compose 使用示例
配置好加速源后,无需修改 docker-compose.yml,自动使用加速拉取镜像。
docker-compose.yml 示例(Nginx + MySQL)
version: "3.8"
services:
web:
image: nginx:latest
ports:
– "8080:80"
volumes:
– ./nginx/conf:/etc/nginx/conf.d
db:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test_db
volumes:
– mysql-data:/var/lib/mysql
volumes:
mysql-data:
运行与停止命令
# 启动服务(后台运行)
docker compose up -d
# 查看状态
docker compose ps
# 停止服务(保留数据)
docker compose down
# 停止并删除数据卷(谨慎使用)
docker compose down -v
containerd 单独使用示例
# 拉取镜像
ctr images pull xxx.xuanyuan.run/library/nginx:latest
# 运行容器
ctr run –rm -t –net-host xxx.xuanyuan.run/library/nginx:latest nginx-test
# 查看容器
ctr containers ls
# 停止容器
ctr tasks stop nginx-test
Podman 使用示例(兼容 Docker 命令)
# 运行 Redis 容器
podman run -d -p 6379:6379 –name redis-test redis:7.2
# 查看容器状态
podman ps
# 进入容器
podman exec -it redis-test redis-cli
# 停止并删除容器
podman stop redis-test
podman rm redis-test
常见问题(FAQ)
Q1:配置加速源后,部分镜像仍拉不下来?
核心原因是 registry-mirrors 仅对 Docker Hub 镜像生效。若拉取 ghcr.io、registry.k8s.io 等第三方仓库镜像,需按对应环境配置专属加速(如 containerd 单独配置各仓库 mirrors,Podman 在 registries.conf 中添加对应镜像源);使用轩辕专业版可获取全仓库加速方案,或联系客服定制地址。
Q2:NAS(群晖、威联通)如何配置?
推荐使用轩辕镜像专业版,步骤如下:
Q3:K8s 部署 Pod 提示镜像拉取失败?
Q4:Podman 提示“insecure registry”错误?
Q5:企业环境如何保障稳定性?
总结
建议收藏本文,每月会更新镜像源可用性及配置细节。
![Linux 文件系统详解:为什么说一切皆文件?[从零开始学Linux 第二篇]-171主机测评](https://www.171host.com/wp-content/uploads/2026/11/20261102160953-6ae8b5d196ebc-220x150.png)


