Containerd配置镜像加速
【代码】Containerd配置镜像加速。
·
参考地址:containerd/config.md at main · containerd/containerd · GitHub
1. 修改Config.toml文件
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/etc/containerd/certs.d" # 镜像地址配置文件
[plugins."io.containerd.grpc.v1.cri".registry.auths]
[plugins."io.containerd.grpc.v1.cri".registry.configs]
[plugins."io.containerd.grpc.v1.cri".registry.headers]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
2. 创建相应目录
mkdir /etc/containerd/certs.d/docker.io -pv
3. 配置加速
cat > /etc/containerd/certs.d/docker.io/hosts.toml << EOF
server = "https://docker.io"
[host."https://xxxxxxxx.mirror.aliyuncs.com"]
capabilities = ["pull", "resolve"]
EOF
4. 重启Containerd
systemctl restart containerd
5. 重新拉取镜像
ctr i pull docker.io/library/mysql:latest
更多推荐
已为社区贡献15条内容
所有评论(0)