whb
whb

Reputation: 689

docker with bower, grunt

I'm trying to build a docker image with grunt and bower but i get the following exception

2015/01/19 23:21:55 The command [/bin/sh -c grunt] returned a non-zero code: 1

similar exception printed for bower too. my Dockerfile is like.

what can be the problem ?

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

BTW. i did not grasp all this docker thing. I enter the image with

docker run -t -i a87274a7f3b7  /bin/bash

and jast run

grunt

but nothing happens it just doest nothing and doesnot give any error.

edit this one seems working

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

Upvotes: 4

Views: 8465

Answers (1)

Paul
Paul

Reputation: 27473

In the Ubuntu repository node is not nodejs, it is a ham radio node program called ax25-node, that gets installed as /usr/sbin/node. Grunt then gets confused, as it is merely a script with shebang #!/usr/bin/env node and will execute whatever equates to node on the $PATH.

To fix:

replace

RUN     apt-get install -y node npm git git-core

with

RUN     apt-get install -y nodejs npm git git-core

Upvotes: 3

Related Questions