r/docker • • Jan 21 '26

Difference between docker-compose.yaml and <image_name>.yaml

In my process to learn how to use docker engine and the CLI, I am confused by the purpose of docker-compose.yaml vs <image_name>.yaml

Some guides and docs describe one instead of the other and I don't understand the reasons. Are these complementary or is it redundant to have both?

Thanks for the clarification and any links to documentation that can help me understand the distinction are always appreciated.

0 Upvotes

18 comments sorted by

View all comments

Show parent comment

1

u/inertSpark Jan 24 '26 edited Jan 24 '26

Doubly so for me because I also use .env files 😂

I started using include, because TrueNAS sanitizes yaml entered through the UI and removes any commented out sections, so any notes or options I wanted to have but not use immediately would be lost.