docker和containerd 配置文件

    • docker /lib/systemd/system/docker.service
    • containerd /lib/systemd/system/containerd.service
      1. [Service]
      2. Environment="HTTP_PROXY=socks5://127.0.0.1:1080/"
      3. Environment="HTTPS_PROXY=socks5://127.0.0.1:1080/"
      4. Environment="NO_PROXY=localhost,mirror.aliyuncs.com,registry-1.docker.io,registry.cn-hangzhou.aliyuncs.com,10.96.0.0/12,127.0.0.1/8,172.31.0.173/24,172.17.0.1/16,192.168.237.1/32"

    重新加载服务程序的配置文件

    1. systemctl daemon-reload

    重启程序

    1. systemctl restart docker
    2. systemctl restart containerd

    验证是否配置成功

    1. systemctl show --property=Environment docker
    2. systemctl show --property=Environment containerd

    参考 设置代理 https://neucrack.com/p/286