This commit is contained in:
48
Containerd/Docs/新版Containerd配置镜像加速.md
Normal file
48
Containerd/Docs/新版Containerd配置镜像加速.md
Normal file
@@ -0,0 +1,48 @@
|
||||
> 本文作者:丁辉
|
||||
|
||||
# 新版Containerd配置镜像加速
|
||||
|
||||
> 本文适用于 Containerd v2.2.0 版本添加镜像加速(备注:各版本添加镜像加速参数具有差异请对照好版本)
|
||||
>
|
||||
> 查看 Containerd 版本 `containerd --version`
|
||||
|
||||
1. 查看是否存在镜像加速
|
||||
|
||||
```bash
|
||||
containerd config dump | grep -A 10 -B 5 "mirrors"
|
||||
```
|
||||
|
||||
2. 创建镜像加速读取目录(官方推荐)
|
||||
|
||||
```bash
|
||||
mkdir -p /etc/containerd/certs.d/docker.io/
|
||||
```
|
||||
|
||||
3. 添加镜像加速
|
||||
|
||||
```bash
|
||||
vi /etc/containerd/certs.d/docker.io/hosts.toml
|
||||
```
|
||||
|
||||
内容如下
|
||||
|
||||
```toml
|
||||
server = "https://registry-1.docker.io"
|
||||
|
||||
[host."https://registry.cn-hangzhou.aliyuncs.com"]
|
||||
capabilities = ["pull", "resolve"]
|
||||
[host."https://mirror.ccs.tencentyun.com"]
|
||||
capabilities = ["pull", "resolve"]
|
||||
[host."https://docker.m.daocloud.io"]
|
||||
capabilities = ["pull", "resolve"]
|
||||
[host."https://swr.cn-north-4.myhuaweicloud.com"]
|
||||
capabilities = ["pull", "resolve"]
|
||||
```
|
||||
|
||||
4. 重启程序
|
||||
|
||||
```bash
|
||||
systemctl restart containerd
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user