-
-
Notifications
You must be signed in to change notification settings - Fork 189
Docker: Specify health check start period and interval #439
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
Conversation
Thanks. Unfortunately there are compatibility issues with From memory those timeout / delay options in Docker are quite a mess and very badly documented. I'm fairly sure that this is the main option you're after here (ie: the one that would actually make a real difference), so my question is, would an alternative (without |
The default start interval, if unspecified, is 5s which is better than nothing. In order for it to kick in, start period needs to be set though, as start period does not have a good default. So start period let's say 5s or 10s without start interval would be ok and yield an improvement -- in practice decreasing reaching healthy state from the current 15s to 5s. So, that would be e.g. HEALTHCHECK --interval=15s --start-period=10s CMD /mailpit readyz 5s is still a pretty bad developer experience, but an out of the box improvement anyway. |
Dropped Should that be a comment in the Dockerfile instead/in addition? For example # --start-interval would be nice, but is reportedly not good compatibilitywise.
# --start-period makes the default start interval (typically 5s) kick in where available. |
Thanks for the update. I gave this a test (locally), and it still took exactly 15 seconds before a I then revisited the So the way I see it I have two choices:
I think I'll go for option 1 (if you don't mind changing it back.... sorry to hassle you!) - with the condition that I may have to revert the change if I start getting bug reports. So if you don't mind reverting your change I will then merge that change. Thank you. |
I tested it yesterday too, and it (adding just the start period) made the described difference to me. I just retested, and it still does. Reproducer: $ grep HEALTHCHECK Dockerfile
HEALTHCHECK --interval=15s --start-period=10s CMD /mailpit readyz
$ docker build -t meh .
[...]
$ docker run --rm --name mailpit-test -d meh; sleep 4; for i in {1..3}; do docker ps | grep mailpit-test; sleep 1; done
8f06168b525ab0ee2b30b5a9055a6177a1063a9db103a40790106a1f46277cd1
8f06168b525a meh "/mailpit" 4 seconds ago Up 4 seconds (health: starting) 1025/tcp, 1110/tcp, 8025/tcp mailpit-test
8f06168b525a meh "/mailpit" 5 seconds ago Up 5 seconds (health: starting) 1025/tcp, 1110/tcp, 8025/tcp mailpit-test
8f06168b525a meh "/mailpit" 6 seconds ago Up 6 seconds (healthy) 1025/tcp, 1110/tcp, 8025/tcp mailpit-test My docker is, on Ubuntu 24.10:
But I'm happy to pretend I didn't say any of the above and put --start-interval=1s back there :) |
To reach healthy state faster at startup.
Done in decd239 |
Thank you. It goes to show the differences between Docker versions... I'm using Ubuntu 24.10 too, but using the default Anyway, this has been merged, and will be included in the next release (I try not release too often) ❤️ |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [axllent/mailpit](https://github.com/axllent/mailpit) | patch | `v1.22.2` -> `v1.22.3` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>axllent/mailpit (axllent/mailpit)</summary> ### [`v1.22.3`](https://github.com/axllent/mailpit/blob/HEAD/CHANGELOG.md#v1223) [Compare Source](axllent/mailpit@v1.22.2...v1.22.3) ##### Feature - Add dump feature to export all raw messages to a local directory ([#​443](axllent/mailpit#443)) ##### Chore - Update node dependencies - Update Go dependencies - Specify Docker health check start period and interval ([#​439](axllent/mailpit#439)) ##### Fix - Correctly detect maximum SMTP recipient limits, add test - Update Swagger JSON to prevent overflow ([#​442](axllent/mailpit#442)) - Include font/woff content type to embedded controller - Replace TrimLeft with TrimPrefix for webroot path handling ([#​441](axllent/mailpit#441)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNzAuMSIsInVwZGF0ZWRJblZlciI6IjM5LjE3MC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
To reach healthy state faster at startup.
https://docs.docker.com/reference/dockerfile/#healthcheck