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 complains about invalid compose file #527

Closed
cmurczek opened this issue Feb 24, 2017 · 6 comments
Closed

docker-compose complains about invalid compose file #527

cmurczek opened this issue Feb 24, 2017 · 6 comments

Comments

@cmurczek
Copy link

Expected behavior

In compose file:

version: "3"
services:
  image: myimage
  myservice:
    healtcheck:
      test: exit 0

  image: myotherimage
  myotherservice:
    depends_on:
      myservice:
        condition: service_healthy

docker-compose up should start services in order and start second only if first is healthy. (see compose file reference and Dockerfile reference)

Actual behavior

when running docker-compose up compose complains that depends_on contains an invalid value. the contents of depends_on should be an array
compose is happily processing the file given above when setting the version to 2.1

Information

  • Docker for Windows 17.03.0-ce-rc1-win1 (1083)
  • Channel: beta
  • docker-compose 1.11.1
@dgageot
Copy link
Member

dgageot commented Feb 24, 2017

Hi @hindsight20-20 Can you try with an array syntax? Like the first example here: https://docs.docker.com/compose/compose-file/#/dependson

@cmurczek
Copy link
Author

Hi @dgageot,
I already did. Using the array notation it'll only accepts strings, so I can't pass the healthcheck condition along. I'd need to use the object notation for that which apparently is not compatible with array. So it is either


depends_on:
  - db

or

depends_on:
  db:
    condition: service_healthy

but not

depends_on:
  - db:
      condition: service_healthy

One thing I'm not sure of: with V3 am I supposed to always use docker-stack? I'm still using docker-compose ...

@dgageot
Copy link
Member

dgageot commented Feb 24, 2017

@hindsight20-20 Could you create an issue on docker/compose and close the issue here? This is not something we can fix on the Docker for Windows side.

@londoncalling
Copy link

londoncalling commented Feb 26, 2017

@hindsight20-20, you can use either docker-stack.yml or docker-compose.yml with v3. There are still some limitations/ pros/cons on both right now. I'll make some things clearer in the docs based on your feedback.

@rn
Copy link
Contributor

rn commented Mar 3, 2017

this is already tracked as docker/compose#4305 so closing this issue

@rn rn closed this as completed Mar 3, 2017
@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants