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
Restarting Unhealthy Containers #4826
Comments
That's more of a Docker Engine feature. Here is a good place to start. |
Thanks for the quick response @shin- |
@shin- so, basically you've pointed to a "there is no way to do it" answer and "we won't do it in Docker". AFAIU, it is exactly the job for an orchestration tool and docker compose is kinda that thing. I'd say this should be implemented in restart policy or somehow. Moreover, that was there in version 2 compose file in |
I don't think this should be in Docker (Moby) but it should probably be in docker-compose. I understand you want people to use swarm but swarm is not a solution for just running some integration tests or a local dev environment. We are using https://hub.docker.com/r/willfarrell/autoheal/ for now! |
I just want to make sure I am not missing anything in regards to how health checks and restart policies work together. It would seem that when a container is marked as "unhealthy" by a health check, there is no way to instruct compose to restart the container. This is because restart policies only take effect based on the exit code of the container itself.
Is there some way to instruct docker compose to restart an unhealthy container? If not, can anybody suggest an appropriate workaround?
Please note that I understand that orchestration tools like kubernetes can handle these situations. The use case here is for lightweight offline deployments using
docker compose up -d
, without the need for robust orchestration like kubernetes.The text was updated successfully, but these errors were encountered: