Docker:在Ubuntu主机

时间:2015-06-15 13:35:30

标签: node.js npm docker dockerfile

我为我的应用程序创建了一个Dockerfile,如下所示

FROM ubuntu:14.04
MAINTAINER Shaun Thomas

RUN echo "deb http://de.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse" > /etc/apt/sources.list
RUN apt-get update -y

RUN apt-get install -y curl software-properties-common git

RUN mkdir /nodejs && curl http://nodejs.org/dist/v0.10.38/node-v0.10.38-linux-x64.tar.gz | tar xvzf - -C /nodejs --strip-components=1
ENV PATH $PATH:/nodejs/bin

RUN npm install -g pm2@0.14.0

在最后一步,npm install需要很长时间才能安装软件包(~55分钟)。如何提高npm安装速度并获得安装反馈,而不是看起来像是被挂起?

注意:

我在npm安装期间收到以下警告

npm WARN optional dep failed, continuing fsevents@0.3.6

有时会出现错误

npm ERR! fetch failed https://registry.npmjs.org/yargs/-/yargs-1.3.3.tgz

我知道Docker构建过程是I / O密集型的。我使用硬盘而不是SSD。我正在寻找除了更换我的硬盘以提高npm安装速度之外的解决方案。

更新

我在Ubuntu 14.04中遇到了上述问题。当我尝试使用boot2docker在Windows 8.1中构建相同的Dockerfile时,它超级快(约2分钟)。这提出了一个问题;我在Ubuntu中缺少什么配置?

0 个答案:

没有答案