DEV Community

Cover image for STOP versioning your Docker Compose file

STOP versioning your Docker Compose file

Pradumna Saraf on August 09, 2024

Docker Compose is one of the best inventions, it makes local development easy and friction-free. If you are a long-term Docker Compose fanatic like...
Collapse
 
denys_bochko profile image
Denys Bochko

Never knew that, I use docker-compose a lot, but I never thought of reading that fact.

At first, I thought you meant "source controlling" when you said versioning, but then I realized it's about that first line in the file. thanks, will take it to my projects.

Collapse
 
theicesentinel profile image
TheIceSentinel

Second this. Maybe change it to "Stop using version in your docker compose" so it's more clear. Of course, clicks might be the point, but this is good to know. Will use on projects also.

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Thank you, Thelce.

No, it was not about clicks :). This was the only title that first came to my mind. I didn't think of Git

Thread Thread
 
denys_bochko profile image
Denys Bochko

I can understand how that came to your mind. The title suggested by TheIceSentinel would have worked for me in terms of clarity and I would still read the article since I use docker-compose.

I shared the knowledge in another article on this site the same day.

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Thank you, Denys.

Collapse
 
rlvdx profile image
Raphaël Louvradoux

I third this :). I opened this post for the exact same reason then understood that you were talking about something that I was aware of 👌

Collapse
 
zirkelc profile image
Chris Cook

I’m not an expert on Docker, but the difference between using docker-compose with dash and docker compose without dash, seems to depend if you’re using the Compose standalone version vs the plugin.

Compose standalone
Note that Compose standalone uses the -compose syntax instead of the current standard syntax compose.
For example type docker-compose up when using Compose standalone, instead of docker compose up.
docs.docker.com/compose/install/st...

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Thanks for pointing it out Chris. I should have made it clearer. I have fixed that

Collapse
 
shricodev profile image
Shrijal Acharya

Now, Docker is more active in getting this version form out of compose files by giving you a warning in the terminal.

Wow, I've never noticed this warning pop up on my terminal before. When did they start adding it?

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Thanks. Recently, a couple of weeks ago.

Collapse
 
hylke94 profile image
Hylke de Vries

I knew about the version line and the command change, since our last rewrite of our dev environment. But not about the file name. Since when is this different? And does it too have benefits?

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Thank you. They have changed a long time ago. I think the Docker team didn't promote that much about it.

Collapse
 
asqiriba profile image
Hassan

Found useful, thanks!

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Glad. Thank you, Hassan

Collapse
 
codemeisterav profile image
avelops • Edited

Could have been more straight forward there, thanks for the tip

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Thank you!

Collapse
 
zero_001 profile image
zero

Cool

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Thank you, Zero

Collapse
 
joephill11 profile image
joephill11

this is very interesting and i never knew this had changed ive only been using docker a little over a year so this is good to know.

Collapse
 
wulu profile image
wulu

‌‌Thank you, this really helped me sort out my thoughts. I have two Raspberry Pis running different Linux distributions and Docker versions, which often confuses us. Now I'm much clearer.