背景
国内docker官方镜像仓库无法访问,可通过配置代理仓库的方式拉取拉取需要的镜像
docker
1、编辑配置文件:vim /etc/docker/daemon.json
{
"registry-mirrors": [
"https://dockerproxy.com",
"https://docker.chenby.cn",
"https://dockerpull.com",
"https://dockerhub.jobcher.com",
"https://docker.mirrors.ustc.edu.cn",
"https://hub.uuuadc.top",
"https://mirror.baidubce.com",
"https://mirror.ccs.tencentyun.com",
"https://docker.m.daocloud.io",
"https://docker.nju.edu.cn",
"https://docker.mirrors.ustc.edu.cn",
"https://hus-mirror.c.163.com",
"https://dockerhub.azk8s.cn",
"https://registry.cn-hangzhou.aliyuncs.com"
]
}
2、重启docker:systemctl restart docker
3、验证
containerd
1、config.toml
文件: vim /etc/containerd/ config.toml
2、添加 registry-mirrors
配置
[plugins."io.containerd.grpc.v1.cri".registry]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
endpoint = [
"https://dockerproxy.com",
"https://docker.chenby.cn",
"https://dockerpull.com",
"https://dockerhub.jobcher.com",
"https://docker.mirrors.ustc.edu.cn",
"https://hub.uuuadc.top",
"https://mirror.baidubce.com",
"https://mirror.ccs.tencentyun.com",
"https://docker.m.daocloud.io",
"https://docker.nju.edu.cn",
"https://docker.mirrors.ustc.edu.cn",
"https://hus-mirror.c.163.com",
"https://dockerhub.azk8s.cn",
"https://registry.cn-hangzhou.aliyuncs.com"
]
3、重启containerd:systemctl restart containerd
4、验证