ekkis
ekkis

Reputation: 10226

What is the version directive for?

I've read through the docs at: https://docs.docker.com/compose/compose-file/ and find no reference to a directive that seems to be present in all sample docker-compose.yml files I've seen, namely the version

is that meant to indicate the version of docker-compose to be used? or is it an arbitrary version number I can assign?

Upvotes: 1

Views: 196

Answers (1)

Tomasz
Tomasz

Reputation: 274

the version in the docker-compose file is describing the Compose file formats and is linked to specific docker engine versions. More info can be found just couple links lower from what you found: https://docs.docker.com/compose/compose-file/compose-versioning/

You cannot specify whatever you want, the current options are: 3.1, 3.0, 2.1, 2.0, 1.0.

Each version is also add or deprecating options and enables new docker engine capabilities to be used like swarm in v3.

Upvotes: 1

Related Questions