sameersbn / docker-nodejs

Dockerfile to build a nodejs+express image with nodemon
MIT License
7 stars 7 forks source link

boot2docker and commands #2

Open florentvaldelievre opened 9 years ago

florentvaldelievre commented 9 years ago

Hi,

Have you tried your image on boot2docker ? It does not seem to recognize commands (node, npm etc.) on the host even if the executables are here

Cheers

sameersbn commented 9 years ago

@florentvaldelievre no I have not tried it using boot2docker. The wrapper script sets the PATH=/usr/sbin:/usr/bin:/sbin:/bin and expects nodejs, npm, etc. to be available at these paths. Probably, this is not true in your case. The wrapper script could use some work there I guess.

florentvaldelievre commented 9 years ago

@sameersbn : I am not sure if its related to the path: docker run -it --rm -v /usr/bin:/target sameersbn/nodejs:latest install

ls -al /usr/bin

lrwxrwxrwx    1 root     root             6 Mar  4 11:18 node -> nodejs
-rwxrwxrwx    1 root     root           248 Mar  4 11:18 nodejs
lrwxrwxrwx    1 root     root             6 Mar  4 11:18 nodemon -> nodejs
lrwxrwxrwx    1 root     root             6 Mar  4 11:18 npm -> nodejs
docker@boot2docker:/usr/bin$ pwd
/usr/bin
docker@boot2docker:/usr/bin$ node
-sh: node: not found
docker@boot2docker:/usr/bin$ sudo node
sudo: unable to execute /usr/bin/node: No such file or directory

Any clue ?

sameersbn commented 9 years ago

@florentvaldelievre as per the installation instructions

docker run -it --rm -v /usr/local/bin:/target \
sameersbn/nodejs:latest install

, will install the wrapper scripts at /usr/local/bin. The wrapper scripts will look for nodejs, npm, etc. at the following paths /usr/sbin/, /usr/bin/, /sbin/ and /bin/ and it they are found at those paths, the container will not be started and instead the host installed binaries will be used.