Start container only when previous container has run and stopped

  Kiến thức lập trình

I have a situation in which I will have four containers in my docker-compose file.
The second is dependent upon the first, and the third is dependent upon the second and fourth on third. But here is the catch, I want that the second should only start when the first has run , completed it’s process and stopped. then the same for third and fourth. After the fourth container has run and completed it’s process and stopped, the first should start agian, and the cycle continues.

Is their a way i can acheive this using docker-compose file?

Currently i havent found any solution on google.

New contributor

sohaib aftab is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT