Docker Tip #99: Prefer Using compose.yaml over docker-compose.yml
Technically both file name variants are supported but the official Docker Compose spec suggests using compose.yaml.
Prefer video? Here’s a recorded version of this tip on YouTube which covers this topic.
This is a friendly reminder to use compose.yaml
. As a fallback Docker
Compose will look for docker-compose.yml
if it doesn’t exist. This is
mentioned in the official
specification.
According to the release notes, support for compose.yaml
was added in
1.28.6 back in March
2021. In case you’re wondering, all Docker Compose v2 versions support it too.
At this point, everyone should be running at least that version!
All of my example Docker starter web apps have been updated for this.