Skip to content
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

Expose HEALTHCHECK method to Dockerfile task #1205

Merged

Conversation

marcospereira
Copy link
Contributor

Closes #1204.

What?

This adds a new instruction to support HEALTHCHECKs:

https://docs.docker.com/engine/reference/builder/#healthcheck

Users will be able to configure health checks by declaring tasks such as:

task createDockerfile(type: Dockerfile) {
    ...
    healthcheck(
      new Dockerfile.Healthcheck('/bin/check-running')
        .withTimeout(Duration.ofSeconds(10))
        .withInterval(Duration.ofSeconds(20))
        .withRetries(10)
    )
}

Resulting in:

...
HEALTHCHECK --timeout=10s --interval=20s --retries=10 CMD /bin/check-running

Copy link
Owner

@bmuschko bmuschko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for providing the pull request. Looks solid!

* Input data for a {@link HealthcheckInstruction}.
*
* @see <a href="https://docs.docker.com/engine/reference/builder/#healthcheck">Dockerfile reference / HEALTHCHECK</a>.
* @since ???
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change that on my end.

@bmuschko bmuschko merged commit 638634a into bmuschko:master Nov 29, 2023
3 checks passed
@bmuschko bmuschko added this to the v9.4.0 milestone Nov 29, 2023
@bmuschko bmuschko changed the title ISSUE-1204: Add HEALTHCHECK instruction for Dockerfiles Expose HEALTHCHECK method to Dockerfile task Nov 29, 2023
@marcospereira marcospereira deleted the issues/1204/healthcheck-instruction branch November 30, 2023 05:49
@marcospereira
Copy link
Contributor Author

Thanks for the quick merge/release, @bmuschko! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add instruction for HEALTHCHECK
2 participants