RUN npm install上的Dockerfile构建错误

时间:2014-05-30 06:40:12

标签: node.js npm docker

我运行Docker构建,使用Dockerfile构建图像。但我在npm install上遇到错误:

Dockerfile:

# Download Runnable-web Repo
RUN eval $(ssh-agent) > /dev/null && ssh-add /.ssh/id_rsa && git clone git@github.com:CodeNow/runnable-web.git 

WORKDIR runnable-web 
RUN npm install 
RUN bower install  --allow-root

错误:

Step 5 : RUN npm install
 ---> Running in 3fefdf5af71d
npm ERR! install Couldn't read dependencies
npm ERR! Error: ENOENT, open '/runnable-web/package.json'
 If you need help, you may report this log at:
     <http://github.com/isaacs/npm/issues>
 or email it to:
     <npm-@googlegroups.com>

 Linux 3.13.0-24-generic
 "/usr/local/bin/node" "/usr/local/bin/npm" "install"

1 个答案:

答案 0 :(得分:0)

我在目录C:\中尝试了这是一个共享驱动程序。它会向你发出同样的错误。

enter image description here

然后我将Dockerfile移动到C:\Intel这样的子目录并将其cd运行docker build .,它可以正常运行

enter image description here

所以我猜Dockerfile不应放在共享的dirver根目录中。