在Docker构建镜像时,如何设置程序的自启动?
创建容器时,指定程序自动启动。
如何同时运行多个程序?
比如我自建一个LTMP(Tengine)容器,如何使mysql、Tengine跟随容器的启动而启动?
阿神2017-04-24 09:15:46
The program auto-start can be configured when building the image. This has nothing to do with docker
巴扎黑2017-04-24 09:15:46
You can set dependencies and manage multiple services in the docker-compose configuration file docker-compose.yml.
怪我咯2017-04-24 09:15:46
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!