Skip to content

Docker

Ubuntu安装

ubuntu配置代理

参考文章

yangchnet.github.io/Dessert/posts/env/安装与配置clash/ www.noseeflower.icu/ zhuanlan.zhihu.com/p/15657792425

修改后文件

# /etc/systemd/system/clash.service
[Unit]
Description=Clash Proxy Service
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/clash -f /home/zhaozhan/.config/clash/config.yaml
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target

测试效果

curl -I https://www.google.com image

Docker配置

安装docker

docs.docker.com/engine/install/ubuntu/

配置代理

sudo vim /etc/systemd/system/docker.service.d/http-proxy.conf
文件中输入以下内容:
[Service]
Environment="HTTP_PROXY=127.0.0.1:7890"
Environment="HTTPS_PROXY=127.0.0.1:7890"
Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
终端输入:
sudo systemctl daemon-reload
sudo systemctl restart docker