分类: Docker | 标签: docker,镜像源,加速源,国内镜像 | 发布时间: 2025-11-02 02:59:05
本文内容仅限学习研究,请勿违规使用。建议收藏,以便获取后续更新。
本文汇总了当前可用且稳定的 Docker 镜像访问支持地址,覆盖 Docker、K8s containerd、Podman 等主流场景,零基础用户也能按步骤完成配置。
- 地址:https://mirror.ccs.tencentyun.com
- 仅推荐在腾讯云服务器上使用,其他环境可能无法正常访问
- 地址:https://xxx.mirror.aliyuncs.com(不同账号专属地址不同)
- 仅推荐在阿里云 ECS 环境中使用,需配合自身账号配置
- 免费版(适合常规用户)
- 地址:https://docker.xuanyuan.me
- 无需登录,免费使用
- 境内 CDN 加速,访问稳定
- 兼容 Linux 桌面/服务器/NAS 设备,支持 containerd、Podman 环境
- 提供官网搜索功能,方便查找镜像
- 专业版(适合开发者、科研人员、企业及 NAS 用户)
- 地址:https://xuanyuan.cloud
- 需登录,提供专属访问支持地址(如 xxx.xuanyuan.run),访问表现更稳定
- 支持 K8s(k3s/cri-o)、群晖/威联通/极空间 NAS 等特殊环境
- 提供企业级支持、售后服务及定制化配置方案
脚本支持 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 配置目录并写入加速配置
# 创建配置目录
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- 验证配置:执行
docker info | grep "Registry Mirrors" -A 3,输出包含https://docker.xuanyuan.me即配置成功
- 点击菜单栏 Docker 图标 → Preferences
- 找到 Daemon → Registry mirrors
- 添加地址
https://docker.xuanyuan.me - 点击 Apply & Restart 完成重启
- 进入 Docker Desktop 设置 → 左侧 Docker Engine
- 按以下格式修改配置(替换 xxx.xuanyuan.run 为专属地址)
{
"insecure-registries": ["xxx.xuanyuan.run"],
"registry-mirrors": ["https://xxx.xuanyuan.run", "https://docker.xuanyuan.me"]
}- 点击 Apply & Restart,通过
docker info验证生效
- 右键点击右下角 Docker 图标 → Settings
- 打开 Docker Daemon 配置,修改 JSON 内容
{
"registry-mirrors": ["https://docker.xuanyuan.me"]
}- 点击 Apply,等待 Docker 重启完成
- 进入 Docker Desktop → Settings → Docker Engine
- 按以下格式修改配置(替换 xxx.xuanyuan.run 为专属地址)
{
"insecure-registries": ["xxx.xuanyuan.run"],
"registry-mirrors": ["https://xxx.xuanyuan.run"]
}- 点击 Apply 重启,通过
docker info查看 Registry Mirrors 确认生效
适用于 Kubernetes(k3s/cri-o)或自建 containerd 环境,提升镜像拉取访问表现。
| containerd 版本 | 是否支持 |
|---|---|
| < 1.4 | 不支持(语法差异) |
| 1.4 ~ 1.7.x | 完全支持 |
| ≥ 1.7.x | 推荐使用 |
查看当前版本:containerd --version
- 初始化配置文件(若未生成)
containerd config default > /etc/containerd/config.toml- 编辑配置文件:
sudo nano /etc/containerd/config.toml - 在
plugins."io.containerd.grpc.v1.cri".registry.mirrors节点下添加以下内容(替换 xxx.xuanyuan.run 为专属地址)
[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:"适用于无守护进程的轻量场景,兼容 Docker 命令习惯。
- 新建自定义配置文件(推荐,避免覆盖系统默认配置)
sudo nano /etc/containers/registries.conf.d/custom.conf- 写入以下配置(替换 xxx.xuanyuan.run 为专属地址)
# 默认搜索 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"- 保存文件(Ctrl+O → 回车 → Ctrl+X)
# 拉取测试镜像
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.yml,自动使用加速拉取镜像。
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# 拉取镜像
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# 运行 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核心原因是 registry-mirrors 仅对 Docker Hub 镜像生效。若拉取 ghcr.io、registry.k8s.io 等第三方仓库镜像,需按对应环境配置专属加速(如 containerd 单独配置各仓库 mirrors,Podman 在 registries.conf 中添加对应镜像源);使用轩辕专业版可获取全仓库加速方案,或联系客服定制地址。
推荐使用轩辕镜像专业版,步骤如下:
- 登录轩辕官网,在「NAS 配置」专区选择对应设备型号;
- 按指引进入 NAS 的 Docker/containerd 配置界面(群晖需开启 SSH,威联通进入容器 Station 高级设置);
- 粘贴专属访问支持地址,保存并重启 NAS 容器服务;
- 拉取 nginx:latest 测试访问表现。
- 检查 config.toml 是否配置了 Pod 所需镜像的仓库(如 registry.k8s.io);
- 重启 containerd 后,通过
kubectl describe pod <pod-name>查看错误日志; - 若为证书错误,可在对应仓库配置下添加
tls_config = { insecure_skip_verify = true }(仅测试环境使用); - 若为 endpoint 不可达,确认访问支持地址正确性,或联系轩辕客服排查。
- 若访问支持地址为 HTTP 协议:确保 registries.conf 中对应仓库
insecure = true,并开放对应端口; - 若为 HTTPS 协议:检查地址是否包含 https://,且服务器证书有效;自签证书需放入
/etc/containers/certs.d/xxx.xuanyuan.run/目录。
- 使用轩辕专业版「企业专属节点」,获取独立 IP 和带宽;
- 配置多节点 fallback(如
endpoint = ["https://node1.xxx.xuanyuan.run", "https://node2.xxx.xuanyuan.run"]); - 搭建 Harbor 本地镜像缓存,同步常用镜像;
- 开通「企业级监控」,实时查看节点状态和拉取日志。
- 常规用户:优先使用一键安装脚本,或手动配置轩辕免费加速源
https://docker.xuanyuan.me,满足日常需求; - 专业/企业用户:选择轩辕镜像专业版,获取专属地址,支持全环境适配和稳定售后服务;
- K8s/集群用户:重点配置 containerd 的多仓库加速,确保集群部署不超时;
- Podman 用户:通过 registries.conf 配置加速,适合轻量场景使用。
建议收藏本文,每月会更新镜像源可用性及配置细节;遇到问题可查看轩辕镜像官网 FAQ(https://xuanyuan.cloud/faq),或联系官网客服获取
