Containerd 配置文件末尾追加了如下配置:
root@ip-172-31-13-117:~# cat /var/lib/rancher/k3s/agent/etc/containerd/config.toml [plugins.cri.registry.mirrors] [plugins.cri.registry.mirrors."docker.io"] endpoint = ["https://fogjl973.mirror.aliyuncs.com", "http://registry-1.docker.io"]完整配置示例
"192.168.50.119": endpoint: - "http://192.168.50.119" "docker.io": endpoint: - "https://fogjl973.mirror.aliyuncs.com" - "http://registry-1.docker.io" configs: "192.168.50.119": auth: username: '' # this is the registry username password: '' # this is the registry password tls: cert_file: '' # path to the cert file used in the registry key_file: '' # path to the key file used in the registry ca_file: '' # path to the ca file used in the registry "docker.io": auth: username: '' # this is the registry username password: '' # this is the registry password tls: cert_file: '' # path to the cert file used in the registry key_file: '' # path to the key file used in the registry ca_file: '' # path to the ca file used in the registry 参考链接K3s私有镜像仓库配置:
https://docs.rancher.cn/docs/k3s/installation/private-registry/_index
Containerd配置镜像仓库:
https://github.com/containerd/cri/blob/master/docs/registry.md