Monday 5 June 2017

docker build error in Dockerfile

When I try to run 'docker build .' or 'docker build - < Dockerfile', errors appeared as below:

  1. [root@VM_60_90_centos dtask-ctrip-train-domestic]# docker build . Sending build context to Docker daemon 38.98 MB Step 1 : FROM ubuntu:14.04 ---> 132b7427a3b4 Step 2 : MAINTAINER Ke Peng ---> Using cache ---> db9529465f77 Step 3: WORKDIR /opt/app ---> Using cache ---> 3122f40a8e56 Step 4 :COPY . ./ ---> 4d67a5fbf128 Removing intermediate container c2d83602f613 Step 5 : RUN npm install ---> Running in 67680232cbdf

    /bin/sh: 1: npm: not found The command '/bin/sh -c npm install' returned a non-zero code: 127

and my Dockerfile like this:

  1. FROM ubuntu:14.04 MAINTAINER Ke Peng WORKDIR /opt/app COPY . ./ RUN npm install COPY dist/ /opt/app/ CMD node ./index.js < test.json

Can anyone have similar experience and give me an solution. Very appreciated!



via Jackie Yu

No comments:

Post a Comment