Dependent service not working correctly when defined via `extends`
Description of the issue
I have a docker-compose file that starts a few services from different repos. The repos are also standalone with their own docker-compose files so I want to reuse that. I ended up with:
services:
elasticsearch:
extends:
file: ../other-service/docker-compose.yml
service: elasticsearch
web:
extends:
file: ../other-service/docker-compose.common.yml
service: web
build:
context: ../other-service
depends_on:
- elasticsearch
Then when I do dc up web I see both services correctly creating but there are no logs from elasticsearch. Further, when I ctrl+c out of the process, it only closes the web service. Using docker ps I still see elasticsearch runnnig and I have to do dc down to stop it.
If I define the elasticsearch service in place (exactly the same definition as in the other file) it works perfectly. The service definition is a basic out-of-the-box one:
elasticsearch:
image: elasticsearch:6.5.4
environment:
- ...
ports:
- ...
Context information (for bug reports)
Output of docker-compose version
docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019
Output of docker version
Client: Docker Engine - Community
Cloud integration: 1.0.17
Version: 20.10.7
API version: 1.41
Go version: go1.13.15
Git commit: f0df350
Built: Wed Jun 2 11:56:47 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: b0f5bc3
Built: Wed Jun 2 11:54:58 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.6
GitCommit: d71fcd7d8303cbf684402823e425e9dd2e99285d
runc:
Version: 1.0.0-rc95
GitCommit: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
docker-init:
Version: 0.19.0
GitCommit: de40ad0
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.
I think this was caused by starting a specific service, in which case dependencies start in the background. This is annoying but doesn't have to do with extends
This issue has been automatically marked as not stale anymore due to the recent activity.
Feel free to close
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.
This issue has been automatically marked as not stale anymore due to the recent activity.