Skip to content
This repository has been archived by the owner on Apr 27, 2018. It is now read-only.

[nvm-iojs-latest] Cannot start, no sails #11

Open
IanVS opened this issue Apr 4, 2015 · 3 comments
Open

[nvm-iojs-latest] Cannot start, no sails #11

IanVS opened this issue Apr 4, 2015 · 3 comments

Comments

@IanVS
Copy link

IanVS commented Apr 4, 2015

I'm trying to use nvm-iojs-latest in SANE, but getting the error message:

Cannot start container ee8a1d088eedcb4207730cfe35bca16557ef204c7d561766251bf53129b8d86c: exec: "sails": executable file not found in $PATH

This is the docker-compose.yml:

server:
  image: artificial/docker-sails:iojs-nvm-stable
  command: sails lift
  volumes:
    - server/:/server
  ports:
    - "1337:1337"
@kriswill
Copy link
Contributor

kriswill commented Apr 5, 2015

It doesn't work for a few reasons.

  1. nvm is initialized in the .bashrc, which is only executed in interactive shells.
  2. even with nvm active, if I force an interactive shell, sails won't lift, because grunt isn't installed globally.

you can manually test this with:

kris ~/src/oss/test-sane-docker 
→ docker run --rm -v `pwd`/server/:/server -it artificial/docker-sails:iojs-nvm-stable bash -i -c "sails lift"

if there is a way to disable the grunt-coffescript hooking that sails lift does, it will work. In which case, you can simply modify the docker-compose.yml to include:

server:
  image: artificial/docker-sails:iojs-nvm-stable
  command: bash -i -c "sails lift"
  volumes:
    - server/:/server
  ports:
    - "1337:1337"

keep in mind, the current build of the iojs-nvm-stable is built with iojs 1.5.1 and an older version of sails. If I have some time tomorrow I'll see if I can update it.

@kriswill
Copy link
Contributor

kriswill commented Apr 5, 2015

P.S., upon reflection perhaps using nvm to install node into these images is not a good way to use a Docker image in sane. I think it would be better and more efficient to just bake in the version of node you want to use, while it would be convenient for switching node versions in a single docker container, it's just as easy to switch which image you want for the node base.

I'll discuss with @Globegitter the next time we chat.

@Globegitter
Copy link
Contributor

@kriswill yeah I think removing nvm does sound like a good decision. If you have some time in-between your hiatus, that would be a great update. Would love to have it in 0.1.0 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants