when nerdctl compose can support service health check #4679
Answered
by
mg1986jp
guangdashao
asked this question in
Q&A
|
when nerdctl compose can support service health check |
Answered by
mg1986jp
May 28, 2026
Replies: 1 comment
|
Last I checked, Try something like: services:
web:
image: nginx
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10sYou can check the health status with: nerdctl compose ps
nerdctl inspect <container-id> --format '{{ .State.Health }}'If health checks aren't being picked up at all, check your nerdctl version — support was added in a relatively recent version. Also make sure you're running What specific health check behavior are you seeing vs expecting? |
0 replies
Answer selected by
AkihiroSuda
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Last I checked,
nerdctl composedoes support health checks — thehealthcheckdirective in compose files should work. What might be happening is that the health check is defined but not behaving the same as Docker Compose because nerdctl uses containerd's health check implementation under the hood.Try something like:
You can check the health status with:
If health checks aren't being picked up at all, check your nerdctl versio…