-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker compose restart/stop <service> should have an option to affect service's container only #9044
Comments
I assume you have services with |
Let's have a simple example compose file:
Behavior of docker-compose v1: Only the container started in step 1 is restarted. The behavior of v2 can be problematic when I have lots of stopped |
|
I'd like to add more on this is that not only |
Description
Disclaimer: I think the major change in behavior might be intentionally done but in that case, there should be an option to use docker-compose v1's behavior.
In docker-compose v1, when you use
docker-compose restart <service name>
, only the service's container(s) is restarted. Other containers that are created bydocker-compose run
are not affected.In docker compose v2, when you use
docker compose restart <service name>
, all containers that are related to the service are restarted. There might be many containers that were created bydocker compose run <service> [command]
that shouldn't be restarted or stopped with the service's container. I don't see any option in the command help that could do that.Output of
docker compose version
:The text was updated successfully, but these errors were encountered: