Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose ps fails for version 2.0 of compose yml #2863

Closed
dzwicker opened this issue Feb 9, 2016 · 20 comments
Closed

docker-compose ps fails for version 2.0 of compose yml #2863

dzwicker opened this issue Feb 9, 2016 · 20 comments

Comments

@dzwicker
Copy link

dzwicker commented Feb 9, 2016

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.

@dnephin
Copy link

dnephin commented Feb 9, 2016

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.

@abuisine
Copy link

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

@dnephin
Copy link

dnephin commented Feb 11, 2016

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

@dnephin
Copy link

dnephin commented Feb 11, 2016

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

@aulsai
Copy link

aulsai commented Apr 30, 2016

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.

@danse
Copy link

danse commented Jun 21, 2016

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

@kausik93
Copy link

kausik93 commented Jul 1, 2016

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?

@NullVoxPopuli
Copy link

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

@ghost
Copy link

ghost commented Oct 27, 2016

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

@ismael74
Copy link

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
Copy link

$ 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

@aanand
Copy link

aanand commented Nov 29, 2016

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

@ismael74
Copy link

$ 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

@aanand
Copy link

aanand commented Nov 29, 2016

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

@rennanalecrim
Copy link

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.

@MisterGlass
Copy link

MisterGlass commented Jan 19, 2017

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

Fixed, was unrelated

@billwright
Copy link

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

@MisterGlass
Copy link

@billwright We were doing the pip install with sudo, which caused issues. This thread might help you #4349

@billwright
Copy link

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.

@vkarpov15
Copy link

@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? :(

@shiftre shiftre mentioned this issue Mar 11, 2017
11 tasks
@shin- shin- closed this as completed Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests