【发布时间】:2019-07-11 14:01:59
【问题描述】:
我想为我的项目创建一个自动启动脚本。我使用 docker 并想尝试在容器启动时启动的脚本。
我尝试运行 update-rc,但没有任何问题,但没有生成符号链接。我在文件资源管理器和我的脚本中检查了它:
mkdir /var/www/$(date +%Y%m%d_%H%M%S)
但是什么也没发生。 这是在我的 dockerfile 中:
COPY starter.sh /etc/init.d/starter.sh
RUN chmod +x /etc/init.d/starter.sh
RUN chmod 755 /etc/init.d/starter.sh
RUN update-rc.d starter.sh defaults 10
我没有收到任何错误消息。那是我的问题:)
【问题讨论】:
-
只需将您的程序作为入口点运行即可。