有时候下载image是失败的,需要设置代理后,才可以正常继续,所以要明白在Containerd里面是如何设置proxy.

containerd 的配置一般位于 /etc/containerd/config.toml 下,service 文件位于:/etc/systemd/system/containerd.service 配置 Proxy 可以通过 service 环境变量方式配置,具体如下:

创建或编辑文件:/etc/systemd/system/containerd.service.d/http-proxy.conf

内容如下:

[Service]
Environment="HTTP_PROXY=http://127.0.0.1:7890"
Environment="HTTPS_PROXY=http://127.0.0.1:7890"
Environment="NO_PROXY=localhost"

配置后保存重启即可:

systemctl daemon-reload
systemctl restart containerd.service

Logo

一站式 AI 云服务平台

更多推荐