我有以下 Dockerfile:
FROM ubuntu:14.10
ENV HOMEDIR /usr/share/iojs
RUN apt-get update && \
apt-get install software-properties-common python-software-properties -qq -y && \
apt-get upgrade -y && \
apt-get install -qq -y supervisor npm
RUN cd ${HOMEDIR} && \
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.26.1/install.sh | bash && \
. ~/.nvm/nvm.sh && \
nvm install iojs
RUN supervisorctl restart iojs
EXPOSE 80
CMD ["/usr/bin/supervisord", "-n"]
和/etc/supervisor/conf.d/supervisord.conf
[supervisord]
autostart=true
autorestart=true
nodaemon=true
[program:iojs]
directory=/usr/share/iojs
command=/usr/bin/iojs index.js
autostart=true
autorestart=true
注意:脚本在/usr/share/iojs