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?
DevOps Stack Exchange is a question and answer site for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure. It only takes a minute to sign up.Sign up to join this community
Well it depends on whether the services (containers) within the docker-compose.yml depends on each other. 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.