Answers: <p>Well it depends on whether the services (containers) within the docker-compose.yml <a href="https://docs.docker.com/compose/startup-order/" rel="nofollow noreferrer">depends on each other</a>. If for example, service B depends on service A, and A fails to start up, so will B. </p>
  
  <p>It can also be the case that a service logically depends on another service (without actually declaring it in your docker-compose.yml), and it not starting up causes a chain of failures. For example, say you have a web service and a db service. If the web service attempts to connect to the db service but the db service couldn't start up (config broken for example), then the web service will probably throw an exception and fail. </p>
  
  <p>But no, just because one service fails, doesn't mean all other services will just be stopped. You can have two independent services, where one fails and stops, while the other is still running. </p>
  
Answers: CC BY-SA 4.0
Answers: 2018-10-10T18:57:17.200Z
Answers: 2018-10-10T18:57:17.200Z
Answers: Anrich
Body: <p>It seems to me that all the containers attempted to be launched are removed if Docker Compose fails for one container being launched.  </p>
  
  <p>Is this standard behavior, or is this just an artifact of my case?</p>
  
Tags: <docker><docker-compose>
Title: What is the behavior if docker compose fails?
UserDisplayName: bnieland
ThreadText: # What is the behavior if docker compose fails?
  
  (Asked by: username_0 on 2018-10-10)
  
  It seems to me that all the containers attempted to be launched are removed if Docker Compose fails for one container being launched.
  
  Is this standard behavior, or is this just an artifact of my case?
  
  **Tags:** docker, docker-compose
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-10-10. Score: 3 | Accepted answer
  
  Well it depends on whether the services (containers) within the docker-compose.yml [depends on each other](https://docs.docker.com/compose/startup-order/). If for example, service B depends on service A, and A fails to start up, so will B.
  
  It can also be the case that a service logically depends on another service (without actually declaring it in your docker-compose.yml), and it not starting up causes a chain of failures. For example, say you have a web service and a db service. If the web service attempts to connect to the db service but the db service couldn't start up (config broken for example), then the web service will probably throw an exception and fail.
  
  But no, just because one service fails, doesn't mean all other services will just be stopped. You can have two independent services, where one fails and stops, while the other is still running.
  
  
  ---
  
  