dockerdocker-compose

Why should you call the Docker Compose file 'compose.yaml' instead of 'docker-compose.yaml'?


I've noticed that the Docker documentation (and spec) 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?


Solution

  • 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 Compose V2.

    It was just a file renaming activity, with no new functionalities associated which, instead, 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, for docker-compose.yml for backwards compatibility of earlier versions.