Skip to content

Extend service with depends_on should work  #7916

@superlevure

Description

@superlevure

Is your feature request related to a problem? Please describe.
Extending services with depends_on does not work and fails with:

services with 'depends_on' cannot be extended

Describe the solution you'd like
From the documentation:

Note: links, volumes_from, and depends_on are never shared between services using extends. These exceptions exist to avoid implicit dependencies—you always define links and volumes_from locally. This ensures dependencies between services are clearly visible when reading the current file. Defining these locally also ensures changes to the referenced file don’t result in breakage.

I interpret this as follows: Extending services with depends_on should work, but you have to redefine your dependencies locally. Which would totally make sense to me.

Describe alternatives you've considered
I don't want to use multiple docker-compose.yml files as there would be no notion of extension of a service (although it is exactly what I want) and it feels like a hacky way to do it.

Additional context
Issue already mentioned:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions