Skip to content

Instantly share code, notes, and snippets.

@wbmins
Last active August 17, 2025 04:51
Show Gist options
  • Save wbmins/2923f9529f7e620de732f73bc646e5c7 to your computer and use it in GitHub Desktop.
Save wbmins/2923f9529f7e620de732f73bc646e5c7 to your computer and use it in GitHub Desktop.

Revisions

  1. wbmins revised this gist Aug 17, 2025. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion docker-setting-proxy.md
    Original file line number Diff line number Diff line change
    @@ -12,12 +12,14 @@ sudo systemctl daemon-reload
    sudo systemctl restart docker

    ## 方法一
    编辑 /etc/docker/daemon.json 增加如下内容
    # 编辑 /etc/docker/daemon.json 增加如下内容
    {
    "proxies": {
    "http-proxy": "http://192.168.1.5:7890",
    "no-proxy": "localhost,127.0.0.0/8",
    "https-proxy": "http://192.168.1.5:7890"
    }
    }
    # 重启服务
    sudo systemctl restart docker
    ```
  2. wbmins revised this gist Aug 17, 2025. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions docker-setting-proxy.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    ```shell
    ## 方法一
    # 1.创建文件
    sudo mkdir -p /etc/systemd/system/docker.service.d
    sudo vim /etc/systemd/system/docker.service.d/http-proxy.conf
    @@ -9,4 +10,14 @@ Environment="HTTPS_PROXY=http://127.0.0.1:8123"
    # 3.重启服务
    sudo systemctl daemon-reload
    sudo systemctl restart docker

    ## 方法一
    编辑 /etc/docker/daemon.json 增加如下内容
    {
    "proxies": {
    "http-proxy": "http://192.168.1.5:7890",
    "no-proxy": "localhost,127.0.0.0/8",
    "https-proxy": "http://192.168.1.5:7890"
    }
    }
    ```
  3. wbmins renamed this gist May 3, 2025. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. wbmins created this gist May 3, 2025.
    12 changes: 12 additions & 0 deletions .md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    ```shell
    # 1.创建文件
    sudo mkdir -p /etc/systemd/system/docker.service.d
    sudo vim /etc/systemd/system/docker.service.d/http-proxy.conf
    # 2.文件内容如下
    [Service]
    Environment="HTTP_PROXY=http://127.0.0.1:8123"
    Environment="HTTPS_PROXY=http://127.0.0.1:8123"
    # 3.重启服务
    sudo systemctl daemon-reload
    sudo systemctl restart docker
    ```