国内镜像
使用包管理可以大大降低引用和管理第三方库的成本,但是很多源都在国外,通过包管理安装的时候,容易超时;我们可以通过修改为国内源,或者使用代理来解决这个问题。
Pip
| 提供方 | 源及使用方式 |
|---|---|
| 豆瓣 | https://pypi.doubanio.com/simple/
|
| 清华大学 | https://pypi.tuna.tsinghua.edu.cn/simple
|
| 阿里云 | https://mirrors.aliyun.com/pypi/simple/
|
Composer
| 提供方 | 源及使用方式 |
|---|---|
| - | https://packagist.phpcomposer.com/
|
| - | https://php.cnpkg.org/
|
| 阿里云 | https://mirrors.aliyun.com/composer/
|
| 华为云 | https://mirrors.huaweicloud.com/repository/php/
|
| 上海交通大学 | https://packagist.mirrors.sjtug.sjtu.edu.cn/
|
| - | https://packagist.jp/
|
NPM
| 提供方 | 源及使用方式 |
|---|---|
| 淘宝 | https://registry.npmmirror.com/
|
| - | http://r.cnpmjs.org/
|
Gem
| 提供方 | 源及使用方式 |
|---|---|
| Ruby China | https://ruby.taobao.org/
|
| 清华大学 | https://mirrors.tuna.tsinghua.edu.cn/rubygems/
|
Maven
| 提供方 | 源及使用方式 |
|---|---|
| 阿里云 | http://maven.aliyun.com/nexus/content/groups/public/
|
代理方式
| 包管理器 | 代理方式 | 使用方式 |
|---|---|---|
| pip | http/https |
|
| composer | http/https |
|
| npm | http/https |
|
| gem | http/https |
|
| go | http/https |
|
| docker | http/https |
docker pull,通过 dockerd 执行,需要修改 /etc/systemd/system/docker.service.d/proxy.conf
之后重启 docker 服务
|
| http/https |
docker run,影响所有 container,需要修改 ~/.docker/config.json
docker run,影响当前 container,在命令中指定
|
|
| http/https |
docker build
|
引用
😉 腾讯云产品特惠热卖,戳我领取!


