-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
compose doesn't show error or exit if depends_on service has exited #9732
Comments
This was referenced Aug 8, 2022
Can report the exact same problem. It hangs even including Just copying @rfay snippet in a folder and running
|
Can confirm this happens on 2.13.0 as well
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
In a compose project using depends_on, for example
if the depends_on service exits before the healthcheck gets done running (apparently) then
docker-compose up
hangs forever waiting for it.Steps to reproduce the issue:
Use the above
docker-compose.yaml
anddocker-compose up -d
You'll get output like this:
Describe the results you received:
docker-compose hangs forever. It doesn't daemonize, doesn't recognize that the db container has exited.
If a container it's depending on has exited, it should exit.
Describe the results you expected:
I would expect a failure if we're depending on a service that exits.
Additional information you deem important (e.g. issue happens only occasionally):
I think this doesn't fail this way if a healtcheck runs quickly and before the container exits. For example, if the container we're depending on has a healthcheck that shows unhealthy before the container exits, compose does the right thing.
Output of
docker compose version
:Docker Compose version v2.7.0
I tested with a couple versions from 2.5.1 to 2.9.0 and got the same results
Output of
docker info
:Additional environment details:
The text was updated successfully, but these errors were encountered: