docker-archive / toolbox

The Docker Toolbox
https://docker.com/toolbox
3.22k stars 1.23k forks source link

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

Open MrSlimCoder opened 5 years ago

MrSlimCoder commented 5 years ago

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"]
RakeshVenkat commented 5 years ago

@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)

MrSlimCoder commented 5 years ago

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

gwartnes commented 5 years ago

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.

MrSlimCoder commented 5 years ago

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

gwartnes commented 5 years ago

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.

MrSlimCoder commented 5 years ago

Great !

lagneshthakur commented 5 years ago

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

MrSlimCoder commented 5 years ago

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

lagneshthakur commented 5 years ago

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

paitonic commented 4 years ago

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.

MrSlimCoder commented 4 years ago

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 ?

paitonic commented 4 years ago

@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.