Date

1、系统代理
vi /etc/profile,追加如下内容:
http_proxy=http://username:password@ip:port

http_proxy=socks5://ip:port
no_proxy=localhost,127.0.0.1
export http_proxy no_proxy
source /etc/profile

2、yum代理
vi /etc/yum.conf,main下插入如下内容:
[main]
proxy=http://ip:port
proxy_username=user
proxy_password=password

3、docker代理
vi /usr/lib/systemd/system/docker.service,service下插入如下内容:
[Service]
Environment=HTTP_PROXY=http://username:password@ip:port
Environment=NO_PROXY=localhost,127.0.0.1
systemctl daemon-reload
systemctl restart docker


Comments