centos替换yum源为阿里云
RUN sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/*.repo \
&& sed -i 's/^#baseurl/baseurl/g' /etc/yum.repos.d/*.repo \
&& sed -i 's/http:\/\/mirror.centos.org/https:\/\/mirrors.aliyun.com/g' /etc/yum.repos.d/*.repo
alpine替换apk源
ENV CONTAINER_PACKAGE_URL mirrors.ustc.edu.cn
RUN sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories \
&& apk update
替换nvm 阿里源
nvm npm_mirror:https://npmmirror.com/mirrors/npm/
nvm node_mirror:https://npmmirror.com/mirrors/node/
npm设置
#查询当前配置的镜像
npm get registry
#设置成淘宝镜像
npm config set registry http://registry.npm.taobao.org/
yarn设置
#查询当前配置的镜像
yarn config get registry // 默认:https://registry.yarnpkg.com
#设置成淘宝镜像
yarn config set registry http://registry.npm.taobao.org/