0%

镜像

常用配置

npm

  • 临时使用

    1
    npm install -g cnpm --registry=https://registry.npm.taobao.org
  • 设为默认

    1
    npm config set registry https://registry.npm.taobao.org
  • 设置官方库

    1
    npm config set registry https://registry.npmjs.org

pip

  • 临时使用

    1
    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
  • 设为默认

    1
    pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

    yarn

  • 临时使用

    1
    yarn save some-package --registry https://registry.npm.taobao.org/ 
  • 设为默认

    1
    yarn config set registry https://registry.npm.taobao.org/
  • 设置官方库

    1
    yarn config set registry https://registry.yarnpkg.com

    Maven

  • vim ~/.m2/settings.xml

    1
    2
    3
    4
    5
    6
    7
    8
    <mirrors>
    <mirror>
    <id>aliyunmaven</id>
    <mirrorOf>central</mirrorOf>
    <name>aliyun maven</name>
    <url>https://maven.aliyun.com/repository/public </url>
    </mirror>
    </mirrors>

docker

  • vim /etc/docker/daemon.json

    1
    2
    3
    {
    "registry-mirrors": ["http://hub-mirror.c.163.com"]
    }
  • 安装

    1
    curl -sSL https://get.daocloud.io/docker | sh

镜像