- 新建文件夹
mkdir /etc/systemd/system/docker.service.d
- 创建文件
/etc/systemd/system/docker.service.d/proxy.conf
[Service]
Environment="HTTP_PROXY=socks5://SERVER:PORT"
Environment="HTTPS_PROXY=socks5://SERVER:PORT"
- 重启服务
systemctl daemon-reload
systemctl restart docker