-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e0c0cc
commit 2df27d1
Showing
3 changed files
with
89 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
title: 'Docker Hub 镜像国内加速' | ||
date: '2024-06-10' | ||
tags: | ||
- docker | ||
--- | ||
|
||
# Docker Hub 镜像国内加速 | ||
|
||
## 1. 配置加速地址 | ||
|
||
创建或修改 `/etc/docker/daemon.json`: | ||
|
||
```shell | ||
mkdir -p /etc/docker | ||
sudo tee /etc/docker/daemon.json <<-'EOF' | ||
{ | ||
"registry-mirrors": [ | ||
"https://dockerproxy.com", | ||
"https://docker.mirrors.ustc.edu.cn", | ||
"https://docker.nju.edu.cn" | ||
] | ||
} | ||
EOF | ||
systemctl daemon-reload | ||
systemctl restart docker | ||
``` | ||
|
||
## 2. 可用列表 | ||
|
||
1. `https://registry.docker-cn.com/` | ||
1. `https://docker.m.daocloud.io/` | ||
1. `https://dockerproxy.com/` | ||
1. `https://mirror.baidubce.com/` | ||
1. `https://docker.nju.edu.cn/` | ||
1. `https://mirror.iscas.ac.cn/` | ||
1. ... | ||
|
||
## 3. 检查加速器是否生效 | ||
|
||
```shell | ||
docker info | ||
``` | ||
|
||
输出中会看到类似下面的内容: | ||
|
||
``` | ||
... | ||
Registry Mirrors: | ||
https://registry.docker-cn.com/ | ||
https://docker.m.daocloud.io/ | ||
https://dockerproxy.com/ | ||
https://mirror.baidubce.com/ | ||
https://docker.nju.edu.cn/ | ||
https://mirror.iscas.ac.cn/ | ||
... | ||
``` |