compose: docker-compose ps fails for version 2.0 of compose yml

The error message ist: In file './common.yml' service 'version' doesn't have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 20

Most upvoted comments

I don’t think this is an issue with ps, the config is failing validation.

What version of docker-compose are you using? Version 2 is only supported by compose 1.6.

If you’re using 1.6, please provide a sample of docker-compose.yml and common.yml.

@ismael74 Version 2 of the file format is only supported by Compose 1.6+.

I did have the same problem. Was working on Mac but not on Linux.

$ docker version
Client:
 Version:      1.10.0
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   590d5108
 Built:        Thu Feb  4 18:36:33 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.10.0
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   590d5108
 Built:        Thu Feb  4 18:36:33 2016
 OS/Arch:      linux/amd64

docker-compose was simply not at the latest version although the docker package was up to date :

$ docker-compose --version
docker-compose version: 1.5.1

Thanks for the response. My solution was to change this line in my circleci.yml from this:

- sudo pip install docker-compose

to this:

- sudo pip install docker-compose==1.8.1

Apparently version 1.9 and above have a bug concerning version 2.0 yml files.

docker-compose is not installed as part of the docker-engine package, see https://docs.docker.com/compose/install/