Blog Post

Using Customer Docker Compose File Names

,

As I use containers more and more to run various things, I decided I not only wanted to set up docker compose files, I wanted to name them something other than docker-compose.yml. While I often have these running in separate folders with separate batch files to start them, I wanted to have the name mean more.

This post shows how to do this.

Creating the File

Obviously the name is the only change. All the other items in your file need to match. For me, I created a new file with YML in it, which looks like the image below. I then saved this as SQL2025.yml, which is the version of SQL Server this container runs.

2025-08_0184

There’s nothing magic here, so I ran this:

docker compose up –d sql2025.yml

That didn’t work. I got docker errors, so I had to search and got a Google AI summary (which I don’t like) that noted there is a –f parameter. I tried this.

docker compose up –d –f sql2025.yml

That didn’t work either. I clicked through on Google to the docs, and I see the –f. However, I noticed that the –f comes before the command.

I then changed this to

docker compose –f sql2025.yml up –d

and things ran. Of course, I needed to alter my “stop” command below, as you can see.

2025-08_0185

Original post (opens in new tab)
View comments in original post (opens in new tab)

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating