Skip to content

Service in extends option should be optional #1361

Closed

Description

@aanm

I think it would be better if the service option to be optional.
compose would look through extends' file and find if there's a service with the same name of the service where the extends option is.

#docker-compose.yml
web:
  extends:
    file: common-services.yml
    #service: web
  environment:
    - DEBUG=1
  cpu_shares: 5
#common-services.yml
web:
  build: .
  ports:
    - "8000:8000"
  volumes:
    - "/data"

Activity

  1. dnephin commented on Sep 29, 2015

    @dnephin

    I think that might be too magical for the extends feature. extends is designed to target a specific service, not assume that it's an override.

    There is a new feature in master #2051 that works as a direct override (not targeting a specific service).

    Does that work?

  2. aanm commented on Sep 29, 2015

    @aanm
    Author

    @dnephin Yes, I was looking for something similar to that.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions