-
Notifications
You must be signed in to change notification settings - Fork 885
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
Add healthcheck command. #972
Comments
Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@piksel and I have been discussing this previously, and came to the conclusion that we don't really know what a healthcheck would even do in the watchtower case. As watchtower runs on a scratch image, it means that watchtower crashing/not working will make the container exit and restart. Any suggestions? |
No takers, so closing this. |
record exit codes from last runs (tmp files?), report latest as health check to catch scenarios such as lifecycle hooks failing |
maybe something like that :
#!/bin/sh
PERIOD_12H=43200
MAX_DELAY=$(( PERIOD_12H + 60 ))
# delay since last loop (seconds)
DELAY=$(($(date +%s) - $(date +%s -r /tmp/last_loop)))
[ "${DELAY}" -gt "${MAX_DELAY}" ] && exit 1
exit 0 And for the dockerfile : it's just an example to improve and adjust with env var. The watchtower job has just to make a touch on the file to update it |
Is your feature request related to a problem? Please describe.
No problems.
Describe the solution you'd like
Add a healthcheck command to the image.
Describe alternatives you've considered
Not asking this question.
Additional context
Just curious if this has been discussed/considered.
The text was updated successfully, but these errors were encountered: