2

Folks:

Thank you in advance for your time and attention.

What is the relationship between docker-compose.yml file and the docker-compose cli executeable is the info that I am trying t?

Here is my example.

$>docker-compose version

docker-compose version 1.9.0, build 2585387
docker-py version: 1.10.6
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1t  3 May 2016
$> docker version
Client:
 Version:      17.04.0-ce
 API version:  1.28
 Go version:   go1.7.5
 Git commit:   78d1802
 Built:        Tue May 30 18:21:18 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.04.0-ce
 API version:  1.28 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   78d1802
 Built:        Tue May 30 18:21:18 2017
 OS/Arch:      linux/amd64
 Experimental: false

Now the docker-compose.yml file

version: "2.2"
services:
  database:
    image: "${DOCKER_REPO_NAME}.......

Based on the documentation at https://docs.docker.com/compose/compose-file, if the docker-engine version is 17.04, it should support docker-compose file version directive 3.2

However I see this. error

***** ERROR follows******

$>docker-compose ${NO_ANSI} config -q


ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

So the question is what am I doing wrong ?

-Narahari

savithari
  • 107
  • 1
  • 9

3 Answers3

2

Your docker-compose is pretty old and just supports up to version 2.1 of docker-compose.yml files.

Version 2.2 is supported by version 1.13.0 or higher.

You either update docker-compose (recommended) or downgrade the .yml to be v1 or v2.1 compliant.

In the .yml reference guide there is a table with compatibilities notes.

Gonzalo Matheu
  • 8,984
  • 5
  • 35
  • 58
1

Docker Compose release 1.9.0...

Introduced version 2.1 of the docker-compose.yml specification. This version requires to be used with Docker Engine 1.12 or above.

It looks like you need at least Docker Compose 1.13.0 to use a compose file with version: "2.2". (I don't see this clearly documented anywhere other than the individual GitHub release pages though.)

David Maze
  • 130,717
  • 29
  • 175
  • 215
1

Version 1.9.0 of docker-compose only supports up to version 2.1 of the compose file specification.

See https://docs.docker.com/release-notes/docker-compose/#190-2016-11-16

Ryan
  • 4,594
  • 1
  • 32
  • 35