使用代理请自备科学上网工具
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