compose icon indicating copy to clipboard operation
compose copied to clipboard

docker-compose ps fails for version 2.0 of compose yml

Open dzwicker opened this issue 10 years ago • 20 comments

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.

dzwicker avatar Feb 09 '16 12:02 dzwicker

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.

dnephin avatar Feb 09 '16 16:02 dnephin

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

abuisine avatar Feb 11 '16 16:02 abuisine

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

dnephin avatar Feb 11 '16 17:02 dnephin

@dzwicker please provide an example of the config file you're using, and the output of docker-compose version

dnephin avatar Feb 11 '16 17:02 dnephin

I've been struggling with the same issue but @dnephin just saved my time.

I'd recommended that upgrade docker-compose to version ^1.6. It will solve this issue.

aulsai avatar Apr 30 '16 16:04 aulsai

Also for me this was due to running docker-compose version 1.5.2. Updating to 1.7 fixed it

danse avatar Jun 21 '16 16:06 danse

I have the same issue as above. I've checked my docker-compose version and it is 1.5.2. I tried upgrading it but it says it is the latest version. Does that mean docker-compose on ubuntu cannot handle version 2?

kausik93 avatar Jul 01 '16 01:07 kausik93

I installed from https://github.com/docker/compose/releases and my problem was resolved. on 1.8 now.

NullVoxPopuli avatar Jul 05 '16 19:07 NullVoxPopuli

I have the same issue even after upgrading the docker-compose from 1.5.x to 1.8.1.

My docker-compose version command gives the following output

docker-compose version 1.8.1, build 878cff1

ghost avatar Oct 27 '16 16:10 ghost

I have same Issue with version 1.12

$ docker-compose build ERROR: In file './docker-compose.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.

$ date mar nov 29 09:20:13 CET 2016

$ docker version Client: Version: 1.12.1 API version: 1.24 Go version: go1.6.2 Git commit: 23cf638 Built: Tue, 27 Sep 2016 12:25:38 +1300 OS/Arch: linux/amd64

ismael74 avatar Nov 29 '16 11:11 ismael74

$ cat docker-compose.yml version: '2' services: db: image: postgres web: build: . command: bundle exec rails s -p 3008 -b '0.0.0.0' ports: - '3008:3008' depends_on: - db

ismael74 avatar Nov 29 '16 11:11 ismael74

@ismael74 what's the output of docker-compose version?

aanand avatar Nov 29 '16 11:11 aanand

$ docker-compose version docker-compose version 1.5.2, build unknown docker-py version: 1.8.0 CPython version: 2.7.12 OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016

ismael74 avatar Nov 29 '16 12:11 ismael74

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

aanand avatar Nov 29 '16 12:11 aanand

Look at this thread, I following this article and it works fine for me in ubuntu 16.04 LTS https://docs.docker.com/compose/install/#/alternative-install-options I just updated by github.

rennanalecrim avatar Dec 28 '16 16:12 rennanalecrim

Suddenly getting this error from my CI since 1.10 was released. 1.9 works fine.

Fixed, was unrelated

MisterGlass avatar Jan 19 '17 16:01 MisterGlass

MisterGlass, what was the fix for your CI. I'm now getting this error from CircleCI, which is running docker-compose 1.10.

billwright avatar Feb 05 '17 13:02 billwright

@billwright We were doing the pip install with sudo, which caused issues. This thread might help you https://github.com/docker/compose/issues/4349

MisterGlass avatar Feb 05 '17 14:02 MisterGlass

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.

billwright avatar Feb 05 '17 23:02 billwright

@billwright thanks, that worked for me as well. Why oh why do I put myself through the horrible pain of running tests through docker-compose? :(

vkarpov15 avatar Feb 11 '17 00:02 vkarpov15