Docker - controlling container startup order

xrapidx

Honorary Master
Joined
Feb 16, 2007
Messages
42,188
Reaction score
4,038
Location
Cape Town
I'm running RancherOS - and have about twenty containers, with various dependencies on other containers, or network, etc.

What is going to be the easiest way to control startup:
e.g Container A only starts up after Container B, which only starts up after Container C
then - Container B also has a dependency on the NAS being up, and shares available.
 
Off the top of my head, and this is pseudo suggestion since I am not familiar with rancherOS, script the startup..

Execute script, it starts first container.. on each container have a health check that is true once the container is up and the script waits for health check to be true, before executing startup of next container..

Make sure the script is not executed from any of the containers, should be from an independent location..
 
Look up Kubernetes. I'm not familiar with it myself but I believe its a containerization orchestration service. It may do what you need
 
Rancher supports docker compose and as such supports “depends_on”
 
Top
Sign up to the MyBroadband newsletter
X