常用代理设置和换源方案
Greetingsyi 工厂拧螺丝大师

docker docker build pip git等常用应用设置镜像源或者代理记录

docker设置国内源

nano /etc/docker/daemon.json

添加以下内容

1
2
3
{
"registry-mirrors": ["https://dockerpull.cn"]
}

docker build设置代理

1
2
3
4
docker build -f docker/Dockerfile.rocm -t vllm-rocm . \
--network host \
--build-arg HTTP_PROXY=http://192.168.48.101:7897 \
--build-arg HTTPS_PROXY=http://192.168.48.101:7897

pip

临时使用清华源

pip install evalscope -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple some-package

pip设置代理

1
2
pip config set global.http_proxy http://192.168.48.101:7897
pip config set global.https_proxy http://192.168.48.101:7897

git设置代理

1
2
git config --global http.proxy http://192.168.48.101:7897
git config --global https.proxy https://192.168.48.101:7897

终端临时设置代理

1
2
export HTTP_PROXY="http://192.168.48.101:7897"
export HTTPS_PROXY="http://192.168.48.101:7897"