常用国内镜像地址和使用方式
Pypi
镜像地址
| 镜像 | 地址 |
|---|
| 豆瓣 | https://pypi.doubanio.com/simple/ |
| 阿里云 | https://mirrors.aliyun.com/pypi/simple |
| 腾讯云 | https://mirrors.cloud.tencent.com/pypi/simple |
使用方式
临时使用
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
镜像地址
| 镜像 | 地址 |
|---|
| 阿里 | https://registry.npm.taobao.org |
| 腾讯云 | http://mirrors.cloud.tencent.com/npm/ |
| 华为 | https://mirrors.huaweicloud.com/repository/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://docker.mirrors.ustc.edu.cn/ |
| Azure | https://dockerhub.azk8s.cn/ |
使用方式
临时使用
注意 不用加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
镜像地址
| 镜像 | 地址 |
|---|
| 阿里 | http://maven.aliyun.com/nexus/content/groups/public/ |
| 腾讯云 | http://mirrors.cloud.tencent.com/nexus/repository/maven-public/ |
使用方式
设置为默认
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
镜像地址
| 镜像 | 地址 |
|---|
| 阿里 | https://mirrors.aliyun.com/goproxy/ |
| 七牛 | https://goproxy.cn |
使用方式
设置为默认
1 2 3 4 5 6 7 8 9 10 11 12 13
| # 启用 Go Modules 功能 go env -w GO111MODULE=on
# 配置 GOPROXY 环境变量,以下三选一
# 1. 官方 go env -w GOPROXY=https://goproxy.io
# 2. 七牛 CDN go env -w GOPROXY=https://goproxy.cn
# 3. 阿里云 go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/
|
PHP Composer
镜像地址
| 镜像 | 地址 |
|---|
| 官方 | https://packagist.phpcomposer.com |
| 腾讯云 | https://mirrors.cloud.tencent.com/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
|