Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check the docker-compose file version?

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?

like image 973
Kurt Peek Avatar asked Apr 27 '17 17:04

Kurt Peek


People also ask

What is Docker compose version?

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)

Which is the command to check your Docker compose file?

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>...]

Where is the Docker compose file?

The default path for a Compose file is ./docker-compose.yml .


2 Answers

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

like image 56
kstromeiraos Avatar answered Sep 29 '22 17:09

kstromeiraos


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.

like image 43
BMitch Avatar answered Sep 29 '22 18:09

BMitch