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

Indicate extends can be used again #13695

Merged
merged 2 commits into from Nov 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion compose/extends.md
Expand Up @@ -179,7 +179,8 @@ $ docker-compose -f docker-compose.yml -f docker-compose.admin.yml \
> of keys added and removed, along with information on [how to upgrade](compose-file/compose-versioning.md#upgrading).
> See [moby/moby#31101](https://github.com/moby/moby/issues/31101) to follow the
> discussion thread on the possibility of adding support for `extends` in some form in
> future versions.
> future versions. The `extends` keyword has been included in docker-compose versions 1.27
> and higher.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello fellow documentation writers 👋

I didn't understand this when reading it. The info box firstly has info about how extends got added and later removed and how it's not supported in 3.x. Then a message that it's included in 1.27 and higher.

Is it possible that someone with good insights into this rewrites this box with a clear indication of which version range of Docker Compose that supports extends and which doesn't?

In 2021, @BretFisher wrote this nice summary:

moby/moby#31101 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benjaoming Thanks for the feedback. Agree that the note needs to clarify support for extends. Created an internal ticket to get this updated. Thank you.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much @usha-mandya ! It was the second time that I ran into the extends support issue. I wasn't able to correctly recall my experience about 4 months ago, so had to read through all the many comments one more time.

I think one of the important additions is also this one about how depends_on isn't possible in combination with extends.

Good luck and thanks, I will definitely need this part of the documentation again in a near future 💯

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@usha-mandya, IIUC - the extend should work on docker-compose version 1.27 and higher, and it's not related to the compose file format version? also, I saw here moby/moby#31101 (comment) that there is a recommendation to remove the version number at the beginning of the compose files, is it true?


Docker Compose's `extends` keyword enables the sharing of common configurations
among different files, or even different projects entirely. Extending services
Expand Down