linux环境下代理操作

在终端环境下

需要在文件: /etc/profile
到最后一行后面新增:

export http_proxy="http://192.168.135.1:7890"
export https_proxy="http://192.168.135.1:7890"

在arcadia应用里面

这是配置 Git 基于 github.com 域名的全局代理(容器内执行)

使用:
git config --global http.https://github.com.proxy socks5h://192.168.135.1:7890
git config --global https.https://github.com.proxy socks5h://192.168.135.1:7890

取消:
git config --global --unset http.https://github.com.proxy
git config --global --unset https.https://github.com.proxy

docker配置

  1. 新建配置文件:/etc/systemd/system/docker.service.d/http-proxy.con
[Service]
Environment="HTTP_PROXY=http://192.168.135.1:7890/"
Environment="HTTPS_PROXY=http://192.168.135.1:7890/"
Environment="NO_PROXY=localhost,127.0.0.1,.example.com"
  1. 重新加载配置并重启服务
systemctl daemon-reload
systemctl restart docker
  1. 检查加载的配置
systemctl show docker --property Environment
  1. 可以看到加载出来的内容
Environment=HTTP_PROXY=http://192.168.135.1:7890/
HTTPS_PROXY=http://192.168.135.1:7890/
NO_PROXY=localhost,127.0.0.1,.example.com

发表评论

电子邮件地址不会被公开。 必填项已用*标注