dockerfile - Docker如何设置程序自启
迷茫
迷茫 2017-04-24 09:13:46
0
4
920

在Docker构建镜像时,如何设置程序的自启动?

创建容器时,指定程序自动启动。

如何同时运行多个程序?

比如我自建一个LTMP(Tengine)容器,如何使mysql、Tengine跟随容器的启动而启动?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(4)
黄舟

Configure the Supervisor daemon to start related services!

阿神

The program auto-start can be configured when building the image. This has nothing to do with docker

巴扎黑

You can set dependencies and manage multiple services in the docker-compose configuration file docker-compose.yml.

刘奇

When you build the image, add it below the Dockerfile

CMD /etc/bootstrap.sh

Then write the script you want to start. Of course, the file location and file name can be changed

When the container is started, the script you want will be automatically executed

Then you can start the service you want in the script and you are done!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template