-
Notifications
You must be signed in to change notification settings - Fork 568
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
Feature request: add HEALTHCHECK #91
Comments
This can be really helpful when running this image in a Kubernetes cluster |
Copying comment from docker-library/cassandra#76 (comment)
|
@yosifkit humbly disagree with your comment, any service should report if can perform what is expected/required to do. |
@yosifkit |
@yosifkit, I also respectfully disagree. Please see my comment docker-library/postgres#282 (comment). |
@yosifkit , I can see the point, but also disagree with this. Docker provides this, and Kubernetes cluster maintainers use this to have basic health check capabilities with their deploys. |
Copying comment from docker-library/cassandra#76 (comment)
|
Indeed, see also https://github.com/docker-library/faq#healthcheck. |
Very late to the party but for anyone from the future - In general I feel that healthchecks shouldn't be enabled by default. However, it certainly isn't a bad idea to provide and document a good basic healthcheck (script included in image, command, etc) - something along the lines of "the running service considers itself to be healthy if X, and 80%+ of users would probably agree". We're in luck; redis already has this. The following compose tidbit works well: healthcheck:
test: ["CMD", "redis-cli", "ping"]
timeout: 10s
retries: 3
start_period: 10s The command returns |
Docker supports defining a command to determine if the container is running as intended (healthy), broken for some reason (unhealthy) or still initializing (starting):
Adding this to this image with the semantic "the redis store is online and functional" would be quite nice.
Since the last HEALTHCHECK defined by a Dockerfile is the one actually used, images based on this one could define their own healthcheck without "interference" by the one provided by the redis image.
The text was updated successfully, but these errors were encountered: