Run a service automatically in a docker container

前端 未结 6 542
予麋鹿
予麋鹿 2020-12-04 09:10

I\'m setting up a simple image: one that holds Riak (a NoSQL database). The image starts the Riak service with riak start as a CMD. Now, if I run it as a daemon

6条回答
  •  我在风中等你
    2020-12-04 09:54

    Using tail to keep container alive is a hack. Also, note, that with -f option container will terminate when log rotation happens (this can be avoided by using -F instead).

    A better solution is to use supervisor. Take a look at this tutorial about running Riak in a Docker container.

提交回复
热议问题