Skip to content

docker compose restart/stop <service> should have an option to affect service's container only #9044

Closed
@lephuongbg

Description

@lephuongbg

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 by docker-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 by docker 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:

Docker Compose version v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions