depends_on is deprecated in docker-compose v3

See original GitHub issue

depends_on does not longer wait for the container to be “ready” instead it will wait for it to be started. To make sure a container is ready one should have a try again loop.

I experienced issues when deploying this, with the deploy script:

services.pgadmin.depends_on must be a list

I don’t know why nobody else had this problem, but for me everything works fine when removing the depends_on lines. This seems to be the expected behavior as stated in the docs:

There are several things to be aware of when using depends_on:

  • depends_on does not wait for db and redis to be “ready” before starting web - only until they have been started. If you need to wait for a service to be ready, see Controlling startup order for more on this problem and strategies for solving it.
  • Version 3 no longer supports the condition form of depends_on.
  • The depends_on option is ignored when deploying a stack in swarm mode with a version 3 Compose file.

Did someone else had this problem? Is it save to remove the depends_on lines?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:16
  • Comments:8

github_iconTop GitHub Comments

6reactions
Ren22commented, Jun 8, 2022

following as docker stack seems to be missing Long syntax indeed

5reactions
Biskit1943commented, Sep 21, 2020

i just got this issue a few minitus ago, how to fix it ?

services.backend.depends_on must be a list

You have to delete all depends_on in your docker-compose.yml. As far as I know the are not mandatory for running 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compose file version 3 reference - Docker Documentation
Reference and guidelines . These topics describe version 3 of the Compose file format. This is the newest version. Compose and Docker...
Read more >
What is the alternative to condition form of depends_on in ...
The current docker-compose documentation states: Version 3 no longer supports the condition form of depends_on. Unfortunately the documentation ...
Read more >
Getting back 'depends_on' in docker-compose - LinkedIn
... depends_on not only doesn't wait for other services to start but it's also been deprecated in docker-compose version 3.
Read more >
Docker Compose: Wait for Container X Before Starting Y
Thus, the client depends on the server. ... The version tag is deprecated after Docker Compose version 3, but it's required in all...
Read more >
fabric8io/docker-maven-plugin
3. Global configuration. Global configuration parameters specify overall behavior like ... This option is deprecated, please use imagePullPolicy instead.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found