Skip to content
Discussion options

You must be logged in to vote

Last I checked, nerdctl compose does support health checks — the healthcheck directive 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:

services:
  web:
    image: nginx
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost/"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s

You 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 versio…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AkihiroSuda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants