I’ve noticed that the Docker documentation now recommends calling Docker Compose’s file compose.yaml
instead of docker-compose.yaml
.
Is there a reason for this change? Does the newer version provide more features?
I’ve noticed that the Docker documentation now recommends calling Docker Compose’s file compose.yaml
instead of docker-compose.yaml
.
Is there a reason for this change? Does the newer version provide more features?
2
Answers
If I had to take a guess at it, it is due to that fact podman also has a compose and podman compose is a strict subset of docker compose. In other words, a podman compose file could be ran by docker compose but a docker compose file will not always be runnable by a podman compose.
At least that’s what I’ve gathered from this redhat link after a quick search on the difference between docker and podman compose.
https://www.redhat.com/sysadmin/podman-compose-docker-compose#:~:text=For%20example%2C%20Podman%20Compose%20can,tested%2C%20and%20likely%20more%20stable.
Actually, this modification is quite old since it was made in 2021 and inserted in the release
1.28.6
, one of the last versions before Docker ComposeV2
.It was just a file renaming activity, with no new functionalities associated which, instead are related and follows the usual Docker Compose releases.
The main difference is that if you execute docker-compose with no options it will search for
compose.yml
first and then, if not present, fordocker-compose.yml
for backwards compatibility of earlier versions.