我一直在尝试缓存node_modules
Docker构建.我尝试了几种方法,包括这里的方法,但没有成功.
我缓存的主要原因是因为构建我的图像需要30多分钟,这太过分了.
我的Dockerfile
:
# This image will be based on the oficial nodejs docker image
FROM node:4.2.1
RUN npm install -g jspm@0.17.0-beta.7 && \
npm install -g gulp && \
npm install -g tsd
# Use changes to package.json to force Docker not to use the cache
# when we change our application's nodejs dependencies:
ADD package.json /src/package.json
RUN cd /src && npm install
# Put all our code inside that directory …
Run Code Online (Sandbox Code Playgroud) 我在Tutum上设置了一个链接到Github存储库的新存储库.这个项目在我的本地机器上成功构建,但是在4小时后它在Tutum上失败并给我以下日志.
Step 27 : ENTRYPOINT /www/run.sh
---> Running in 666e1e87a660
---> eeb9646f9317
Removing intermediate container 666e1e87a660
Successfully built eeb9646f9317
Creating builder1769_sut_1
[Thu Jan 07 17:42:45.675789 2016] [mpm_prefork:notice] [pid 8] AH00163: Apache/2.4.10 (Debian) PHP/5.5.30 configured -- resuming normal operations
[Thu Jan 07 17:42:45.675813 2016] [core:notice] [pid 8] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'
ERROR: Build process returned exit code 137
builder-1769: Terminating...
builder-1769: Terminated
ERROR: Build in 'dockerize' (bcf1bce8) failed in 4:00:52
Run Code Online (Sandbox Code Playgroud)
我的Dockerfile的最后一步27已经到达,Docker返回消息"Successfully built eeb9646f9317",然后"ERROR:Build process返回退出代码137".
这是我的Dockerfile
FROM php:5.5-apache
#Add Servername …
Run Code Online (Sandbox Code Playgroud)