Search code examples
dockerdocker-composedocker-engine

docker-engine to docker-compose to docker compose file relationship


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


Solution

  • 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