Fabien Salles
Fabien Salles

Reputation: 1181

Should I use minor version in my docker-compose file?

Sometimes, I only see major version in docker-compose.yml file like version: '3'. Other times, I can also see the minor version like version: '3.7'

I didn't find any best pratice for this.

Is it better to specify just the major version and be more flexible or fix the format to the minor version and be more strict ?

Upvotes: 5

Views: 1579

Answers (1)

Pylinux
Pylinux

Reputation: 11816

Always specify the minor version, else <major>.0 is used!

From the docker compose documentation:

v2 and v3 Declaration

Note: When specifying the Compose file version to use, make sure to specify both the major and minor numbers. If no minor version is given, 0 is used by default and not the latest minor version.

Upvotes: 3

Related Questions