我正在尝试使用grunt和bower构建docker映像,但是出现以下异常
2015/01/19 23:21:55命令[/ bin / sh -c grunt]返回了非零代码:1
凉亭也印有类似的例外。我的Dockerfile就像。
可能是什么问题?
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y node npm git git-core
RUN ln -s /usr/bin/nodejs /usr/bin/node
COPY . /app
WORKDIR /app
RUN npm install -g bower
RUN npm install -g grunt-cli
RUN npm install
# RUN bower install
RUN grunt
RUN grunt serve
EXPOSE 9000
顺便提一句。我没有掌握所有这些码头工人的事情。我输入图像
docker run -t -i a87274a7f3b7 /bin/bash
和狂奔
grunt
但是什么也没有发生,它什么也不做,也不给出任何错误。
编辑这似乎工作
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y nodejs npm git git-core
RUN ln -s /usr/bin/nodejs /usr/bin/node
COPY . /app
WORKDIR /app
RUN npm install -g bower
RUN npm install -g grunt-cli
RUN npm install
RUN bower install --allow-root
RUN grunt
RUN grunt serve
EXPOSE 9000
在Ubuntu存储库中,节点不是nodejs,它是一个名为ax25-node的无线电节点程序,安装为/ usr / sbin / node。咕噜然后它会很困惑,因为它仅仅是用家当一个脚本#!/usr/bin/env node
,将执行任何等同于node
对$PATH
。
修理:
代替
RUN apt-get install -y node npm git git-core
和
RUN apt-get install -y nodejs npm git git-core
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句