Does 'docker compose up' guarantee deletion before recreating a container that has changed?

Viewed 24

Running docker compose up twice on a project will try to detect if any changes in the docker-compose files necessitate the recreation of existing containers. I want to use this feature, but it is extremely important, in my case, that docker compose must never run two copies of a given container at the same time.

In my experimentation and experience, it seems that docker compose always tears down a container before creating/running the new one. This is the behavior I expect and need, but I have not found any documentation explaining the semantics of this operation or offering any guarantees that this is, in fact, how docker compose will always and must always behave. Is there a specification or documentation somewhere that describes this behavior and/or offers assurances of this?

0 Answers
Related