Docker container management in a production environment
I may have missed something in the Docker documentation, but I'm curious and can't find the answer:
What mechanism is used to restart docker containers if they should mistakenly / close / etc?
Also, if a lot of functionality is to be done with a docker start command, say for example setting a volume or linking volumes, how is the entire container hive called that populates the application without using docker? (as they say, this is not production readiness)
source to share
What mechanism is used to restart docker containers if they should mistakenly / close / etc?
Docker reload policies set with option --restart
to docker run
. From the docker-run(1)
man page :
--restart=""
Restart policy to apply when a container exits (no, on-fail‐
ure[:max-retry], always)
Also, if a lot of functionality needs to be done with a docker start command, say for example setting a volume or linking, how can you create a whole bunch of containers that populate an application without using docker?
Well, of course you can use docker-compose
if it best suits your requirements, even if it is not marked "production ready".
You can research larger container management solutions like Kubernetes or even OpenStack (although I wouldn't recommend the latter if you're not already familiar with OpenStack).
You can create separate unitd files for each container.
source to share