feat(linux): add HEALTHCHECK instruction#2249
feat(linux): add HEALTHCHECK instruction#2249amdadulbari wants to merge 5 commits intojenkinsci:masterfrom
HEALTHCHECK instruction#2249Conversation
There was a problem hiding this comment.
Please use the /health endpoint instead of /login. It was added in Jenkins 2.506. You can read more about the /health endpoint in issue:
Please test that the controller starts and runs as expected. Testing that docker build completes successfully is necessary, but not sufficient for this pull request.
72e6a1c to
4315a17
Compare
Thank you for the feedback! I have updated the HEALTHCHECK instruction to use the I have also verified that the controller starts up correctly and the health check works as expected. Here is the verification summary: Controller Startup:
The changes have been pushed. |
|
Is it possible to have this HEALTHCHECK in Windows images too? Is it possible to put those HEALTHCHECKs more closer to the bottom of Dockerfiles? |
As requested, I’ve moved the HEALTHCHECK instructions to the bottom of the Dockerfiles for the Linux images. |
|
@lemeurherve Thanks for the feedback. Updated accordingly. |
HEALTHCHECK instruction
HEALTHCHECK instructionHEALTHCHECK instruction
|
FTR, there has been discussion years ago about adding This feature is not really portable:
|
This PR is intentionally Docker-scoped to improve the Docker-native experience (docker ps / docker inspect) and does not aim to define a portable or orchestrator-level health signal. While Docker-only, HEALTHCHECK is a well-established convention and provides immediate value for users running Jenkins directly with Docker. Regarding the curl dependency: it’s lightweight, not part of Jenkins’ functional path, and if it’s ever removed the health check can be trivially adjusted without impact. I’m happy to add a short note clarifying these assumptions if needed. |
How? Adding the dependency on curl here makes it harder to remove it. |
To completely avoid the dependency on curl, I could implement a lightweight Java-based health check that relies solely on the JRE already present in the image. Would you prefer I switch to that approach? |
|
Still not really convinced. Can you open an issue explaining in which context and why the Jenkins controller image would need this healthcheck requiring an additional dependency (IOW increasing maintainance burden) please? Note: It's already configurable from the Jenkins helm chart: |
Added
HEALTHCHECKinstruction to thealpine,debian, andrhelcontroller Dockerfiles to improve container orchestration and monitoring reliability. The healthcheck verifies that the Jenkins login page is accessible.Testing done
Validated that the
docker buildcommand successfully parses the Dockerfiles with the newHEALTHCHECKinstruction.Submitter checklist