Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

Docker Tip #99: Prefer Using compose.yaml over docker-compose.yml

docker-tips-and-tricks.jpg

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.

Free Intro to Docker Email Course

Over 5 days you'll get 1 email per day that includes video and text from the premium Dive Into Docker course. By the end of the 5 days you'll have hands on experience using Docker to serve a website.



Comments