Docker Compose File YAML Version 2 vs 3 #81
-
Hi Bret, Thanks for this course it's super useful! I was also watching your talk: https://youtu.be/Zgx0o8QjJk4?t=1906 and see you've used in this course and in your talk recommended version 2 for Docker Compose files. However in the official Docker documentation they recommend v3: https://docs.docker.com/compose/compose-file/compose-versioning/ Looking the the changes I can't see anything that talks about giving up local dev only concerns that you allude to in your talk. Are you able to expand on this a little more; whether this is still applicable today, especially if you're using Amazon ECS for example? Kind regards |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I've been working with them on docs, and it could likely use more effort and bringing the improved doc's idea back to life: I started with this comment: moby/moby#31101 (comment) Then this doc's PR I started: docker/docs#7593 As well as this supplemental doc's PR: docker/docs#7525 |
Beta Was this translation helpful? Give feedback.
-
The practical short version is, if you never intend to use Swarm, stick with You might see notes that indicate what isn't supported in 3.x branch, like this one related to above: https://docs.docker.com/compose/compose-file/#depends_on
|
Beta Was this translation helpful? Give feedback.
-
Hey thanks for the speedy reply! Great thanks very much for explaining 😃 |
Beta Was this translation helpful? Give feedback.
-
Update, if you're only using Note that Swarm is still pinned to only work with v3.x, so you'll need the version key/value in YAML if you're using it with that file. |
Beta Was this translation helpful? Give feedback.
Update, if you're only using
docker-compose
CLI, or the newdocker compose
CLI, then versions are now deprecated and the "version" isCompose Spec
, which means you can remove the version line from your YAML all together and each feature will determine where it's supported dynamically.Note that Swarm is still pinned to only work with v3.x, so you'll need the version key/value in YAML if you're using it with that file.