restart <service> will restart all dependent services #1685
Description
Description
In the old docker-compose restart <service>
it only restarts that specific service.
In docker compose restart <service>
it will first restart services that depends on, including DB's. If healthchecks are used for depends_on
, it'll then have to re-wait for dependent services to be ready again.
Steps to reproduce the issue:
- Create two services in a compose file where Service1
depends_on
Service 2. - Restart Service1.
Describe the results you received:
Service2 will restart, and then Service1 will restart.
Describe the results you expected:
Only Service1 should be affected.
Additional information you deem important (e.g. issue happens only occasionally):
Using Docker Compose version 2.0.0-beta.1
in Docker Desktop 3.3.3 (64133) on macOS
Output of docker version
:
Client:
Cloud integration: 1.0.14
Version: 20.10.6
API version: 1.41
Go version: go1.16.3
Git commit: 370c289
Built: Fri Apr 9 22:46:57 2021
OS/Arch: darwin/amd64
Context: default
Experimental: true
Output of docker context show
:
You can also run docker context inspect context-name
to give us more details but don't forget to remove sensitive content.
default