Lightweight health check client for .NET containerized applications — no curl needed.
In newer versions of Microsoft container images (including chiseled variants), you can't simply install curl to check the status of your app. So how do you run health checks?
dotnet add package MrRabbit.HealthChecks.Container.Clienthealthcheck:
test: ["CMD", "dotnet", "/[PATH TO YOUR APP]/healthcheck.dll", "ADDRESS TO HEALTH CHECK ENDPOINT"]Example:
healthcheck:
test: ["CMD", "dotnet", "/app/healthcheck.dll", "http://localhost:8080/hc"]💡 Works with chiseled container images too!
The NuGet package adds content files that are copied to the build output directory:
healthcheck.dll
healthcheck.runtimeconfig.json
You can also run it manually from a terminal inside the container:
dotnet ./healthcheck.dll http://localhost:8080/hc| Version | Changes |
|---|---|
| 10.0.0 | Added support for .NET 10 |
| 9.0.1 | Removed linux-x64 runtime compilation for Any CPU support |
| 9.0.0 | Added support for .NET 9 |
| 8.0.0 | First release |