artificialio / docker-sails

Docker container for SailsJS, optionally managed by PM2
https://registry.hub.docker.com/u/artificial/docker-sails/
26 stars 7 forks source link

nvm / npm not found fix #8

Closed okket closed 9 years ago

okket commented 9 years ago

Include bash / .bashrc in calls so that nvm can actually do its job and provide a path to node / npm.

Globegitter commented 9 years ago

So have you tested and run into issues with the current Dockerfile? It seems to be working fine in the other files: https://github.com/artificialio/docker-sails/blob/master/iojs-full-stable/Dockerfile#L9

But it is looking good otherwise. Let's just wait to hear back from @kriswill

Globegitter commented 9 years ago

Oohhh I see, the CMD keyword has the potential issue (https://docs.docker.com/reference/builder/#cmd). The RUN should be fine as far as I can tell.

okket commented 9 years ago

The RUN line in iojs-full-stable work because you use the official io.js base image and not the homegrown nvm based one.

The problem with nvm is that it is designed for an interactive shell environment and not for running inside Docker. See also https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html

kriswill commented 9 years ago

I think #9 is a better solution, please review.

okket commented 9 years ago

Yes, indeed.