-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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 (version 3): depends_on contains an invalid type, it should be an array #30404
Comments
ping @dnephin |
@royeectu It looks like this error is when using |
I think this is the correct behaviour. The extended depends field was only added to the v2.1 format.
|
https://docs.docker.com/compose/compose-file/#dependson The doc at the top states
while the example says at the top |
Thanks, yes we need to fix the docs here. We recently split the docs by version, and it seems we missed that during the split. I opened #2278 |
Anybody know if there is a recommended replacement that should be used? Thank you |
any depends_on "condition: service_healthy" check in v.3 so far? |
any news ? |
Here is description how to use it in version 3 https://docs.docker.com/compose/compose-file/#depends_on
Condition is not supported anymore |
P.S. This is ignored when using `docker stack deploy`. [See Here](moby/moby#30404 (comment))
P.S. This is ignored when using `docker stack deploy`. [See Here](moby/moby#30404 (comment))
How is dropping support altogether an improvement? Can anyone point me out to the discussion where the decision was made? |
@lifenautjoe see the discussion on #31333 (and #31333 (comment)). For docker-compose (not |
This requires docker-compose file format 2.4 as the condition is no longer supported in the newer versions. See moby/moby#30404 (comment)
Every time i need to do something in docker-compose -> feature removed -> not doing -> response intentionally left blank -> 5 years later... |
@Strandedpirate New features are going towards http://compose-spec.io |
Q&A: Why is docker compose version downgraded? In v3 depends_on is not supported. moby/moby#30404 (comment)
I can still use the |
@JustusNBB have you changed the syntax from the one mentioned in the documentation? |
For some reason it worked on my OSX machine, but then broke on Jenkins. I added a wait loop to my entrypoint now as an alternative solution, dockerize is also recommended! |
to bypass " depends_on contains an invalid type, it should be an array" exception as discussed in issue moby/moby#30404
This is more confusing! According to that site, the spec is on Github, and the relevant section is here: https://github.com/compose-spec/compose-spec/blob/master/spec.md#long-syntax-1 - which does have depends_on constraints. |
it looks like when using docker-compose the issue arises, i've tried with docker compose and it worked |
Description
Steps to reproduce the issue:
1.Verify that docker-compose 1.10.0 is installed (docker-compose --version)
2. Verify that you are using version 3 file format
3. Validate and view the compose file (docker-compose -f test.yml config)
Describe the results you received:
I got the following error message: ERROR: The Compose file './test.yml' is invalid because:
services.web.depends_on contains an invalid type, it should be an array
Describe the results you expected:
I should get the content of the yml file
Additional information you deem important (e.g. issue happens only occasionally):
If you change the version to: 2.1 it works. The problem only occurs with version: 3
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
The content of the test.yml file:
The text was updated successfully, but these errors were encountered: