I would like to make sure that I'm using version 3 of the compose file format. However, on https://docs.docker.com/compose/compose-file/ I was not able to find out how to do this.
My Docker version is 17.04.0-ce, build 4845c56
, and my Docker-Compose version is docker-compose version 1.9.0, build 2585387
. I'm not sure since when version 3 of the compose file format was introduced, however. How can I find this out?
The Compose file is a YAML file defining services, networks, and volumes for a Docker application. The Compose file formats are now described in these references, specific to each version. Reference file. What changed in this version. Compose Specification (most current, and recommended)
You can also see this information by running docker compose --help from the command line. You can use Docker Compose binary, docker compose [-f <arg>...]
The default path for a Compose file is ./docker-compose.yml .
It's on your docker-compose.yml
file. First parameter is Docker Compose version.
version: '3'
Docker Compose version file 3 was introduced in release 1.10.0 of Docker Compose and 1.13.0 release of Docker Engine.
Here you can see release notes for Docker Compose 1.10.0 which introduces version file 3: https://github.com/docker/compose/releases/tag/1.10.0
The docker compose version 3 syntax requires docker version 1.13 and docker-compose version 1.10 (see the release notes). See the release notes for the version compatibility matrix and upgrade instructions.
Note that the version 3 syntax is designed for docker swarm mode, and it was first supported with the docker stack deploy
in docker release 1.13. There's not much reason to upgrade to the version 3 syntax if you are still using docker-compose
itself.
See also the compose file versioning page that describes the differences between the different yml versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With