使用代理請自備科學上網工具
Docker#
由於不可抗原因,DockerHub 在國內無法訪問,國內鏡像戰也紛紛停止服務,正常服務的國內鏡像開始進行白名單 & 限流 & 降級等措施,使用代理是目前最有效的解決方案
Docker 設置代理#
[root@localhost~]# mkdir -p /etc/systemd/system/docker.service.d/
[root@localhost~]# vim /etc/systemd/system/docker.service.d/proxy.conf
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:10809"
Environment="HTTPS_PROXY=http://127.0.0.1:10809"
Environment="NO_PROXY=localhost,127.0.0.1"
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart docker
Podman 設置代理#
[root@localhost~]# mkdir -p /etc/systemd/system/podman.service.d
[root@localhost~]# vim /etc/systemd/system/podman.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:10809"
Environment="HTTPS_PROXY=http://127.0.0.1:10809"
Environment="NO_PROXY=localhost,127.0.0.1"
[root@localhost~]# systemctl daemon-reload
[root@localhost~]# systemctl restart podman
pip(python)#
國內鏡像#
清華鏡像
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set install.trusted-host pypi.tuna.tsinghua.edu.cn
設置代理#
pip config set global.proxy http://127.0.0.1:10809
npm(nodejs)#
國內鏡像#
阿里鏡像
npm config set registry https://registry.npmmirror.com
設置代理#
npm config set proxy="http://127.0.0.1:10809"
golang#
鏡像加速#
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct