Skip to content
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

[BUG] depends_on option does not work for extended services #12433

Closed
Yurko-Fedoriv opened this issue Jan 6, 2025 · 4 comments
Closed

[BUG] depends_on option does not work for extended services #12433

Yurko-Fedoriv opened this issue Jan 6, 2025 · 4 comments

Comments

@Yurko-Fedoriv
Copy link

Yurko-Fedoriv commented Jan 6, 2025

Description

I'm trying to understand what has changed over the past few weeks, but earlier, I could define working dependencies in both parent end extending services and they would merge just fine.

Today I returned to working on my project, and depends_on seems to be completely ignored in extended service, both for dependencies defined in parent and child service.

Current behaviour: dependencies do not start with docker compose run service command and docker compose up service for services defined via extends: service: parentService
Expected (previous) behaviour: dependencies defined in depends_on would merge and be accounted for when starting extended service.

Steps To Reproduce

  1. Create docker-compose with service hierarchy defined through exends and dependencies defined in depends_on section of either parent or extension service.
  2. execute docker compose up service

Compose Version

Docker Compose version v2.32.1

Docker Environment

Client: Docker Engine - Community
 Version:    27.4.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.19.3
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.32.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 27.4.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 88bf19b2105c8b17560993bee28a01ddc2f97182
 runc version: v1.2.2-0-g7cb3632
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.8.0-51-generic
 Operating System: Ubuntu 24.04.1 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 46.61GiB
 Name: yurko-nuc
 ID: 540e3a0f-f2a1-4a5d-b1f2-4aa453b410a9
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

@Yurko-Fedoriv Yurko-Fedoriv changed the title [BUG] docker compose run does not build images and does not start dependencies [BUG] depends_on option does not work when extends: service is defined Jan 6, 2025
@Yurko-Fedoriv Yurko-Fedoriv changed the title [BUG] depends_on option does not work when extends: service is defined [BUG] depends_on option does not work when extends: service: is defined Jan 6, 2025
@Yurko-Fedoriv Yurko-Fedoriv changed the title [BUG] depends_on option does not work when extends: service: is defined [BUG] depends_on option does not work for extended services Jan 6, 2025
@Yurko-Fedoriv
Copy link
Author

In https://docs.docker.com/compose/how-tos/multiple-compose-files/extends/#exceptions-and-limitations I read that depends_on from parent service is not meant to be propagated to the extension service.

Point 1: it used to work just a few weeks ago
Point 2: dependencies defined in the final service are also ignored.

@Yurko-Fedoriv
Copy link
Author

Forced version: Docker Compose version v2.31.0

The desired behavior is working correctly in this version

@ndeloof
Copy link
Contributor

ndeloof commented Jan 6, 2025

Point 1: as you already identified, this was actually a bug with spec not being correctly implemented
Point 2: fixed by compose-spec/compose-go#721

@ndeloof ndeloof closed this as completed Jan 6, 2025
@ndeloof
Copy link
Contributor

ndeloof commented Jan 7, 2025

see compose-spec/compose-spec#554

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants