常用国内镜像地址和使用方式
Pypi
镜像地址
使用方式
临时使用
1
| pip install flask -i https://pypi.doubanio.com/simple/
|
requirements.txt
第一行加入:
-i https://pypi.doubanio.com/simple/
flask
设置为默认
修改$HOME/.config/pip/pip.conf
[global]
timeout = 60
index-url = https://pypi.doubanio.com/simple/
NPM
镜像地址
使用方式
临时使用
1
| npm install -g yarn --registry=https://registry.npm.taobao.org
|
设置为默认
1 2
| npm config set registry https://registry.npm.taobao.org npm config get registry
|
使用 nrm
可以选择一个最快的镜像仓库。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| ➜ ~ npm install -g nrm
➜ ~ nrm ls
npm -------- https://registry.npmjs.org/ yarn ------- https://registry.yarnpkg.com/ cnpm ------- http://r.cnpmjs.org/ * taobao ----- https://registry.npm.taobao.org/ nj --------- https://registry.nodejitsu.com/ npmMirror -- https://skimdb.npmjs.com/registry/ edunpm ----- http://registry.enpmjs.org/
➜ ~ nrm test
npm ---- 1419ms yarn --- 1859ms cnpm --- 238ms * taobao - 206ms nj ----- Fetch Error npmMirror 4480ms edunpm - Fetch Error
➜ ~ nrm use taobao
Registry has been set to: https://registry.npm.taobao.org/
|
docker repository
镜像地址
使用方式
临时使用
注意 不用加https://
1 2
| docker pull dockerhub.azk8s.cn/library/redis:latest docker pull dockerhub.azk8s.cn/gitea/gitea:latest
|
设置为默认
编辑/etc/docker/daemon.json
1
| { "registry-mirrors": ["https://dockerhub.azk8s.cn/"] }
|
Maven
镜像地址
使用方式
设置为默认
maven 修改 setting.xml
1 2 3 4 5 6 7 8
| <mirrors> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors>
|
Goproxy
镜像地址
使用方式
设置为默认
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io
go env -w GOPROXY=https://goproxy.cn
go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/
|
PHP Composer
镜像地址
使用方式
设置为默认
1
| composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/
|
制定项目
修改当前项目的 composer.json 配置文件:
1
| composer config repo.packagist composer https://packagist.phpcomposer.com
|