https://github.com/meck93/distroless-http-healthcheck
a small, statically linked http client for distroless container health checks
https://github.com/meck93/distroless-http-healthcheck
Last synced: about 2 months ago
JSON representation
a small, statically linked http client for distroless container health checks
- Host: GitHub
- URL: https://github.com/meck93/distroless-http-healthcheck
- Owner: meck93
- License: mit
- Created: 2024-12-14T16:35:41.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-02-16T18:57:45.000Z (3 months ago)
- Last Synced: 2025-02-16T19:33:23.568Z (3 months ago)
- Language: Rust
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# healthcheck
[](https://github.com/meck93/distroless-http-healthcheck/actions/workflows/release.yml)
[](https://github.com/meck93/distroless-http-healthcheck/actions/workflows/build.yml)A tiny HTTP client for distroless container health checks.
It sends a HTTP GET request to the URL passed as argument and exits with 0 if the request succeeds, or 1 if it the URL is invalid, unreachable, or the request fails.
The binary is self-contained (statically linked), so it can be easily copied into containers which require a healthcheck but don't have any other dependencies.## Binary Size
| Binary | Size |
| ------------- | ------ |
| `curl` | 6.1mb |
| `wget` | 1.4mb |
| `healthcheck` | 0.54mb |## Installing `healthcheck`
Binaries are provided for both `x86_64` and `arm64` architectures, both as Docker images and as direct download from the Github releases page.
### Docker
Since this binary is primarily meant to be used for Docker health checks, the easiest way to consume this binary is through Docker.
The binaries are published in the `ghcr.io/meck93/distroless-http-healthcheck` repository in scratch containers, and you can use the version tags or `latest`.See below for an examplary usage in a Dockerfile.
```dockerfile
FROM ghcr.io/meck93/distroless-http-healthcheck:latest AS healthcheckFROM scratch AS runner
COPY --from=healthcheck /healthcheck /healthcheck
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD ["/healthcheck", "http://localhost:8080/healthz"]
CMD ["/example"]
```### Github Releases (Direct Download)
The binary is available through Github Releases, and can be downloaded [here](https://github.com/meck93/distroless-http-healthcheck/releases).
## Credits
This work is heavily inspired by the following project and blog post:
- [cryptaliagy/httpget](https://github.com/cryptaliagy/httpget) - by [Natalia Maximo](https://github.com/cryptaliagy)
- [Docker Health Checks on Distroless Containers with Rust](https://natalia.dev/blog/2023/03/docker-health-checks-on-distroless-containers-with-rust/) - by [Natalia Maximo](https://github.com/cryptaliagy)