开发者福音:国内定制化编程语言镜像一站通

目录

1. Node.js / npm 镜像

2. Python / pip 镜像

3. Maven / Gradle(Java)

4. Rust / crates.io 镜像

5. Go / goproxy 镜像

6. Composer(PHP)镜像

7. Docker 镜像

8. Ruby / RubyGems 镜像


1. Node.js / npm 镜像

针对Node.js和npm,国内常用的镜像是淘宝的 npm 镜像源(cnpm),可以加速下载Node.js模块。

  • 淘宝 npm 镜像 (cnpm)
npm config set registry https://registry.npmmirror.com
  •  或者可以使用 cnpm 命令行工具: 
npm install -g cnpm --registry=https://registry.npmmirror.com

2. Python / pip 镜像

Python的包管理工具 pip 可以配置使用国内的PyPI镜像源,如豆瓣、清华、阿里云等。

  • 豆瓣镜像
pip install -i https://pypi.doubanio.com/simple some-package
  • 清华大学镜像
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
  • 阿里云镜像

pip install -i https://mirrors.aliyun.com/pypi/simple some-package

3. Maven / Gradle(Java)

除了前面提到的Gradle镜像,Maven也可以配置国内镜像源,常见的有阿里云、华为云、清华大学等。

  • 阿里云 Maven 仓库

<mirror>
    <id>aliyun</id>
    <mirrorOf>central</mirrorOf>
    <url>https://maven.aliyun.com/repository/public</url>
</mirror>
  • 清华大学 Maven 仓库

<mirror>
    <id>tsinghua</id>
    <mirrorOf>central</mirrorOf>
    <url>https://mirrors.tuna.tsinghua.edu.cn/repository/maven/</url>
</mirror>

4. Rust / crates.io 镜像

Rust使用 cargo 来管理包依赖,可以配置国内的 crates.io 镜像。

  • 清华大学 Rust 镜像

    在 ~/.cargo/config 中添加以下内容:

[source.crates-io]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index"

5. Go / goproxy 镜像

Go语言可以通过 goproxy 配置国内的代理,加速模块的下载。

  • Go 中国代理

go env -w GOPROXY=https://goproxy.cn,direct

6. Composer(PHP)镜像

PHP的包管理工具Composer也有国内镜像源,可以加速依赖下载。

  • 阿里云 Composer 镜像

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
  • 中国全量镜像(packagist.cn)
composer config -g repo.packagist composer https://packagist.cn

7. Docker 镜像

Docker使用的镜像仓库有国内加速镜像,比如阿里云、网易、DaoCloud等。

  • 阿里云Docker镜像加速

    可以在阿里云容器服务中获取加速地址,然后在 /etc/docker/daemon.json 中配置:

    {
      "registry-mirrors": ["https://<your_accelerator>.mirror.aliyuncs.com"]
    }

    DaoCloud Docker 加速器

    {
      "registry-mirrors": ["http://f1361db2.m.daocloud.io"]
    }

    8. Ruby / RubyGems 镜像

    Ruby的包管理工具 gem 可以配置使用国内镜像源。

  • Ruby China 镜像

    gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/

  • 18
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

何遇mirror

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值