docker 配置下面的镜像源

vi /etc/docker/daemon.json

添加如下配置

{
	"registry-mirrors": ["https://docker.1panel.live", "https://hub.rat.dev/", "https://docker.chenby.cn", "https://docker.m.daocloud.io"]
}

systemctl stop docker
systemctl daemon-reload
systemctl start docker

containerd配置镜像源

# 生成默认配置
mkdir /etc/containerd
containerd config default | tee /etc/containerd/config.toml

vi /etc/containerd/config.toml

添加如下配置

#sandbox_image = "k8s.gcr.io/pause:3.8"
# 注释上面那行,添加下面这行
sandbox_image = "registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.8"

# 配置Containerd直接使用systemd去管理cgroupfs
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
  # 添加下面这行
  SystemdCgroup = true
       

[plugins."io.containerd.grpc.v1.cri".registry] #此行下修改
      config_path = "/etc/containerd/certs.d" # 改为此路径,并且需要在此路径下创建hosts.toml文件,用于存放镜像加速信息

# 创建/etc/containerd/certs.d下的hosts文件
# mkdir -p /etc/containerd/certs.d/docker.io
# vim /etc/containerd/certs.d/docker.io/hosts.toml
server = "https://docker.io"
[host."https://docker.1panel.live"]
  capabilities = ["pull", "resolve"]


systemctl daemon-reload
systemctl restart containerd

如果有用欢迎各位大佬帮忙为我的开源项目 star一下。

github地址:https://github.com/tencentmusic/cube-studio

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐