Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install hangs in NodeSource example "Dockerizing your Node.js Applications"

Tags:

node.js

Working through the very simple example in "Dockerizing your Node.js Applications" I get failures in the docker build step.

https://nodesource.com/blog/dockerizing-your-nodejs-applications

steve@steve-docker:~/projects/docker-tutorial$ docker build -t "myapp" .
Sending build context to Docker daemon 54.27 kB
Step 0 : FROM nodesource/node:4.0
4.0: Pulling from nodesource/node
7a42f1433a16: Already exists 
3d88cbf54477: Already exists 
f7de320a63d8: Already exists 
25ca017f7153: Already exists 
96682a971c4a: Already exists 
51b426f992a7: Already exists 
7c37012fed92: Already exists 
fd06eadac973: Already exists 
9763c03a384a: Already exists 
e4dca69ac79f: Already exists 
Digest: sha256:e0f4a2cef10482abf99a3dda475db22b9f1b3e0441ff5f4c40aa58820cfcaec9
Status: Downloaded newer image for nodesource/node:4.0
 ---> e4dca69ac79f
Step 1 : ADD package.json package.json
 ---> Using cache
 ---> cf6b38206c03
Step 2 : RUN npm install
 ---> Running in fc2c50798256
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data

The already exists are no doubt as I ran it beforehand

I don't know enough yet about docker to be able to debug within the context that docker build is running but npm install works fine in the host context (at command prompt). My guess is something is wrong with the nodesource/node image

I'm running Ubuntu 15.0 x64 in VirtualBox on Windows 10.

like image 569
Steve Lee Avatar asked Jun 09 '26 23:06

Steve Lee


1 Answers

Run npm install directly by navigating to the project root folder. Now run the docker build again - now it will not hang. The reason could be docker unable to create node_modules folder when we run the build command or could be we have to pass permission while running build command

like image 142
Rajasekar Murugesan Avatar answered Jun 14 '26 17:06

Rajasekar Murugesan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!