centos替换yum源为阿里云

  1. RUN sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/*.repo \
  2. && sed -i 's/^#baseurl/baseurl/g' /etc/yum.repos.d/*.repo \
  3. && sed -i 's/http:\/\/mirror.centos.org/https:\/\/mirrors.aliyun.com/g' /etc/yum.repos.d/*.repo

alpine替换apk源

  1. ENV CONTAINER_PACKAGE_URL mirrors.ustc.edu.cn
  2. RUN sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories \
  3. && apk update

替换nvm 阿里源

  1. nvm npm_mirror:https://npmmirror.com/mirrors/npm/
  2. nvm node_mirror:https://npmmirror.com/mirrors/node/

npm设置

  1. #查询当前配置的镜像
  2. npm get registry
  3. #设置成淘宝镜像
  4. npm config set registry http://registry.npm.taobao.org/

yarn设置

  1. #查询当前配置的镜像
  2. yarn config get registry // 默认:https://registry.yarnpkg.com
  3. #设置成淘宝镜像
  4. yarn config set registry http://registry.npm.taobao.org/