-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
clarify v2 vs. v3 compose file format for different use cases #7593
Conversation
Deploy preview for docsdocker ready! Built with commit a88f3db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense to me.
ping @shin- ptal |
@BretFisher @shin- perhaps we should have a longer description of the differences between V2 and V3 in the documentation; also mentioning that the V2 spec is not "frozen", so features are still added to V2 (that may not be in V3). This leads to quite some confusion; docker/cli#1177 |
I added some details to the v1/2/3 summary lines, but wonder if this is enough.
|
@shin- PTAL. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just happened upon this issue while researching the difference between v2 and v3 and found the clarifications to the docs very helpful. Is this still being considered? |
TL;DR
I'd like to use this PR to talk about how we can improve docs for helping people choose either compose file format versions 2.x vs. 3.x. I'm willing to add/change the messaging to help direct people to the correct version for their use case, and this may need to be tweaked in multiple files, but I'd like to get feedback on the right approach and docker team(s) strategy.
@garethr @shin- @thaJeztah (maybe others)
Brief History of Compose Version Usage:
version: 3.1
in early 2017docker run
had and we needed some things in docker-compose that weren't yea in Swarm, so then 2.x was re-born with 2.2 (or 2.1 I can't remember,) and it was useful, but the choice became confusing between 2.x and 3.x.depends_on
" which makes it useful as a separate version fork from the 3.x track which seems focused on multi-node orchestration compatibility.The Problem
The problem is those feature differences are not being talked about much, and this PR is suggesting what might need to be the first of multiple file changes to help educate users on when they should choose 2.x or 3.x for a specific compose file.
When Swarm Mode and 3.x was released, many of us tried to use the "one compose file to rule them all" approach and for various reasons, I don't think it stuck. Even
.env
options, overrides, and templating was not enough to create a single-file experience for dev->test->prod. Too many things like multi-value compose arrays, complexities of dev vs. prod, and version differences have created a world where most teams, including docker's own examples, usedocker-compose.yml
for docker-compose local dev, anddocker-stack.yml
for Stack deployments. Honestly, this is fine, and not something I'm worried about.But the value of 2.x versions and their features since 1.12 release is lost on everyone I meet IRL and online. There's no message that "2.x is of value and should still be used in certain use cases."
The Fix
My assumption is that this is what the current strategy is, and I'd like to help clear it up in docs:
docker run
features, with as much forward compatibility as stacks can support.If this is the case, then what other things besides this small PR file change can support helping people chose their version. Should we have a separate "2 vs. 3" file linked from the main compose files? What other ways can I help make this strategy plain to the compose user?
Thanks for your help.