How to prevent a Docker Container to turn on while another Container in the same Service is trying to?

Viewed 54

I want to prevent several containers to turn on together. i.e imagine that I have a service and I want to turn on 5 replicas of it.

Then They Should Act Like This:

container 1 starting ==> container 1 running and healthy ==> container 2 starts ==> container 2 running and healthy ==> container 3 starts ==> container 3 running and healthy ==> container 4 starts ==> container 4 running and healthy ==> container 5 starts ==> container 5 running and healthy.

I checked HEALTHCHECK, but I don't know exactly if it helps me in this case

Thank you

1 Answers
Related