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?

up vote 3 down vote accepted

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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.