node.js - cannot pm2 list in docker containers -


i build docker image node.js , pm2. started container with:

docker run -d --name test -p 22 myimage 

then go inside container with:

docker exec -it test /bin/bash 

in container, exec command:

pm2 list 

and stuck here:

enter image description here

p.s.: application works in docker container, if add cmd pm2 start app.js in dockerfile.

if dockerfile cmd pm2 command, have include --no-daemon arg option pm2 runs in foreground , docker container continues run.

an example dockerfile cmd:

cmd ["pm2", "start", "app.js", "--no-daemon"] 

otherwise, without --no-daemon, pm2 launches background process , docker thinks execution of pm2 command done running , stops.

see https://github.com/unitech/pm2/issues/259


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -