Please prepare your own scientific internet access tools when using a proxy.
Docker#
Due to uncontrollable reasons, DockerHub is inaccessible in China, and domestic mirror services have also ceased operations. Domestic mirrors that are still functioning have begun implementing whitelist, throttling, and degradation measures. Using a proxy is currently the most effective solution.
Setting up Proxy for 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
Setting up Proxy for 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)#
Domestic Mirrors#
Tsinghua Mirror
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set install.trusted-host pypi.tuna.tsinghua.edu.cn
Setting up Proxy#
pip config set global.proxy http://127.0.0.1:10809
npm (nodejs)#
Domestic Mirrors#
Ali Mirror
npm config set registry https://registry.npmmirror.com
Setting up Proxy#
npm config set proxy="http://127.0.0.1:10809"
golang#
Mirror Acceleration#
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct