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?
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.
linking 2 containers through docker compose
Files created by manage.py commands not chown'd from root user
Is it possible to create an intermediate image within docker-compose?
docker-compose service listen on specified interface
Does Docker-Compose allow overwriting of ports when using extends?
Jhipster Docker-compose conflict
Build multiple images with Docker Compose?
JHipster Cassandra Docker Build
Defining project name inside docker-compose configuration
Docker-compose named mounted volume
cannot ping linked docker container service
How to do variable substitution in env_file?
How to create stack in tutum with docker-compose.yml file?
ecs-cli docker compose version
dynamic link update in docker-compose
How to start arbitrarily many identical containers with docker-compose?