StefanScherer / dockerfiles-windows

Various Dockerfiles for Windows Containers
MIT License
1.11k stars 396 forks source link

Can't seem to find NPM install #433

Closed SliceofCheese closed 4 years ago

SliceofCheese commented 4 years ago

I tried making a very basic image for testing this to see how a nodejs with windows would work, and mine doesn't seem to see NPM at all. I'm not entirely sure what's happening here. Any advice?

Base image

FROM stefanscherer/node-windows:10.15.3-pure-2016

set working directory

WORKDIR /src

install and ache app dependencies

COPY package.json /src/package.json RUN npm install RUN npm install -g @angular/cli@latest

add app

COPY /src /src

start app

CMD start --host 0.0.0.0

I should also mention that I'm using this from Azure DevOpps.

StefanScherer commented 4 years ago

The "pure" image only contains the "node.exe" and nothing else. This is used eg. as a final stage in a Dockerfile where you only deploy the final built application.

Have a look at https://hub.docker.com/r/stefanscherer/node-windows

Try the nanoserver based image 10.15.3 that also has npm inside the image.

SliceofCheese commented 4 years ago

Alright. Makes sense. I suppose I misread its use there. Funnily enough, I ended up finding a way, but this is much better than what I had. Thank you.