A container with restart always which depends on another container does not automatically start the other container
Description
A service, marked restart always, will not cause a service that it depends on to restart automatically.
Steps to reproduce the issue:
- Use a docker-compose file like this:
child:
image: ...
parent:
image: ...
depends_on:
- child
restart: always
- Restart the system
Describe the results you received: The child service is not started automatically.
Describe the results you expected: The child service is started automatically because the parent service depends on it. (Also appropriate would be a warning of the behavior that will occur in this situation, or documentation to this effect)
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker compose version:
Docker Compose version v2.1.1
Output of docker info:
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Build with BuildKit (Docker Inc., v0.6.3)
compose: Docker Compose (Docker Inc., v2.1.1)
scan: Docker Scan (Docker Inc., 0.9.0)
Server:
Containers: 7
Running: 0
Paused: 0
Stopped: 7
Images: 33
Server Version: 20.10.10
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc version: v1.0.2-0-g52b36a2
init version: de40ad0
Security Options:
seccomp
Profile: default
Kernel Version: 5.10.47-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.938GiB
Name: docker-desktop
ID: ZRS7:7FKH:LSY5:IAQA:YMNG:77MU:JSVR:UDBI:SLWQ:VQUD:I7JD:R2NS
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Additional environment details:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it had not recent activity during the stale period.
This issue has been automatically closed because it had not recent activity during the stale period.