得有一个富强别相信加速地址

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

    sudo mkdir -p /etc/systemd/system/docker.service.d
    sudo nano /etc/systemd/system/docker.service.d/http-proxy.conf

  2. 在http-proxy.conf文件中添加以下内容

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

  3. 重新加载系统守护进程并重启 Docker:

    sudo systemctl daemon-reload
    sudo systemctl restart docker

  1. 检查变量是否加载

    systemctl show docker --property Environment

  2. 取消代理

    rm /etc/systemd/system/docker.service.d/http-proxy.conf -rf
    systemctl daemon-reload
    systemctl restart docker
    systemctl show docker --property Environment

标签: none

添加新评论