4

I run a Docker build, using a Dockerfile to build an image. But I get an error on 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

Error:

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"
Thomas Uhrig
  • 30,811
  • 12
  • 60
  • 80
Sandip Singh
  • 106
  • 1
  • 7
  • http://stackoverflow.com/questions/21926425/docker-having-trouble-running-npm-install-after-creating-a-new-user – Sandip Singh May 30 '14 at 06:40
  • http://stackoverflow.com/questions/8844708/npm-install-error – Sandip Singh May 30 '14 at 06:40
  • possible duplicate of [Dockerfile/npm: create a sudo user to run npm install](http://stackoverflow.com/questions/21906419/dockerfile-npm-create-a-sudo-user-to-run-npm-install) – zishe May 30 '14 at 06:42
  • Are you sure the git command is cloning the repo into the /runnable-web/ directory? That error looks to me like the file isn't found (but it is present in the git repo, in the root), so maybe you're not cloning into the correct directory. Try moving your WORKDIR command above your RUN? – Jay Dorsey Oct 25 '17 at 02:11

1 Answers1

0

I tried it in Directory C:\ which is a shared driver.It throws the same error with yours.

enter image description here

Then I move Dockerfile to a sub directory like C:\Intel and cd it to run docker build ., it works

enter image description here

So I guess Dockerfile should not be placed in shared dirver root directory.

亚里士朱德
  • 510
  • 5
  • 15