docker-archive/toolbox

npm install hangs after installing all dependencies from package.json Node Js in docker toolbox

Opened this issue ยท 12 comments

Hi ,
I'm using docker for windows 7 i have created dockerFile which is simple file for installing dependencies etc .
When build occur's on npm install step , i install all dependencies correctly but when installation is completed build does not move to next step of dockerFile.

My DockerFile Configuration

FROM node:10-alpine
WORKDIR .
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 8080
CMD ["npm","run" , "dev"]

@viveksharmaui If I am allowed to comment on your issue, I just wanted to ask did you get this issue to be resolved? Even I face the same issue on a Windows 2016 server (base image: stefanscherer/node-windows)

I didn't find any solution i think the problem is in my system and not in image .

I'm also having this same exact issue...been working through it for the past few hours with no success.

Edit

After waiting for about 15 minutes after my npm install step, it did eventually continue.

Wow that great ! did you find the reason why it's happen ?

Wow that great ! did you find the reason why it's happen ?

Nope. But after a subsequent try, it took much less time to continue, maybe about 1 or 2 minutes.

Great !

It did not work for me even after waiting more than 20 minutes.

Simply uninstall docker toolbox i think members are not maintaining it .

Turns out the VPN was the issue. So if anyone faces this over VPN, should switch that off and try again.

I got it working without the VPN, thanks @viveksharmaui

Not using docker toolbox, but I found this issue by looking for solution to the same problem.

Also I found this: Docker build (Windows) hangs after RUN 'npm install'

Since I am working on frontend project, after the build completes I can remove node_modules/:

RUN npm install && npm run build && rm -rf node_modules/

This resolved the 15min wait that I had between this RUN and the next one.

Not using docker toolbox, but I found this issue by looking for solution to the same problem.

Also I found this: Docker build (Windows) hangs after RUN 'npm install'

Since I am working on frontend project, after the build completes I can remove node_modules/:

RUN npm install && npm run build && rm node_modules/

This resolved the 15min wait that I had between this RUN and the next one.

@vladimirZe according to the command you are running build it is suitable for production but what if I'm working in development ? i need to create a build each time ?

@vladimirZe according to the command you are running build it is suitable for production but what if I'm working in development ? i need to create a build each time ?

Yes, it was for production.
Not sure have to solve that but maybe you can use cache (docker run without --no-cache) and rebuild it only when one of you dependencies was changed.