compose-spec / compose-spec

The Compose specification

Home Page:https://compose-spec.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is `extends` supported in V3 or not?

SteffRhes opened this issue · comments

What is the problem you're trying to solve
I've found contradicting infos. Here, according to the V3 spec https://docs.docker.com/compose/compose-file/compose-file-v3/ I don't find extends and it says that it was removed here: https://docs.docker.com/compose/compose-file/compose-versioning/#version-3, but in this repo here I can find it: https://github.com/compose-spec/compose-spec/blob/master/05-services.md#extends .

Using extends with docker-compose also works, when using version docker-compose version 1.29.2, build 5becea4c and a compose.yml with version: "3" and a service having extends another one from another compose.yml

Do I mix something up or is this indeed contradicting?

by compose specification there's no "v3" anymore. Compose specification is version-less and just ignores the version attribute, and you should just stop using it. Compose-file v2 and v3 documentation is part of the "Legacy versions" section, you should only refer to those for archeology.

extends definitively is part of the spec

when using version docker-compose version 1.29.2

compose v1 is end-of-life, you should use docker compose v2

Excellent. Thank you!