What does the first line in the "docker-compose.yml" file, that specifies the version mean?

In the first line of the docker-compose.yml file we specify a version:

version: '3.9'

What exactly does this mean?!

After installing the latest version, I tried the following in my Windows 10 cmd:

docker-compose --version

and the output was:

Docker Compose version v2.17.2

so how is it that we type 3.9 in the first line?!

>Solution :

https://docs.docker.com/compose/compose-file/04-version-and-name/

Top-level version property is defined by the specification for backward compatibility but is only informative.

It specifies the version of the compose file schema, not the version of docker-compose.

Leave a Reply