如果需要在使用 ctr
命令时通过代理连接到 Kubernetes 的 CRI runtime,可以通过设置环境变量来实现。
以下是使用 HTTP 代理的示例:
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
ctr c list
如果你需要使用 SOCKS5 代理,可以将环境变量修改为:
export ALL_PROXY=socks5://proxy.example.com:1080
ctr c list
这些环境变量会被 ctr
自动识别并使用。更多信息可以参考 containerd文档。