修复node下cnpm无效的问题

This commit is contained in:
KennyLee 2017-03-01 17:22:29 +08:00
parent 09ac9938b7
commit cd6a705c71
3 changed files with 7 additions and 9 deletions

View File

@ -39,9 +39,6 @@ RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \
WORKDIR $HOME
# add cnpm for taobao registry
RUN alias cnpm="npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"
RUN echo '\n#alias for cnpm\nalias cnpm="npm --registry=https://registry.npm.taobao.org --cache=$HOME/.npm/.cache/cnpm --disturl=https://npm.taobao.org/dist --userconfig=$HOME/.cnpmrc"' >> ~/.bashrc
CMD [ "node" ]

View File

@ -12,9 +12,6 @@ RUN apk --no-cache update && \
rm -fr /tmp/* /var/cache/apk/*
# add cnpm for taobao registry
RUN alias cnpm="npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"
RUN echo '\n#alias for cnpm\nalias cnpm="npm --registry=https://registry.npm.taobao.org --cache=$HOME/.npm/.cache/cnpm --disturl=https://npm.taobao.org/dist --userconfig=$HOME/.cnpmrc"' >> ~/.bashrc
CMD [ "node" ]

View File

@ -3,7 +3,11 @@
## 说明
1. 基于 [官方Node](https://hub.docker.com/_/node/) 镜像。
2. 本地化修改,参见 https://dev.aliyun.com/detail.html?repoId=26157
2. 本地化修改。
* 基础版,参见 https://dev.aliyun.com/detail.html?repoId=26157
* alpine版本参见 https://dev.aliyun.com/detail.html?repoId=26182
3. 内置cnpm命令使用 `淘宝 NPM 镜像` 解决国内资源网络问题可使用cnpm来安装模块。详细可参考 https://npm.taobao.org/
**注基于alpine的镜像没中文支持。**