Skip to content

compose: support healthcheck field in service config#4869

Open
opjt wants to merge 2 commits intocontainerd:mainfrom
opjt:feat/healthcheck
Open

compose: support healthcheck field in service config#4869
opjt wants to merge 2 commits intocontainerd:mainfrom
opjt:feat/healthcheck

Conversation

@opjt
Copy link
Copy Markdown
Contributor

@opjt opjt commented Apr 27, 2026

Summary

services.<SERVICE>.healthcheck was listed as unimplemented — this PR wires it up.

compose-go already parses the healthcheck block, so this is mostly connecting
it to the existing --health-* flags in serviceparser.

Limitations:

  • CMD exec form is converted to CMD-SHELL since --health-cmd always stores the command as CMD-SHELL (see withHealthcheck in pkg/cmd/container/create.go)
  • start_interval is not supported — I plan to work on this after this PR is merged.

Test plan

services:
  web:
    image: nginx:alpine
    healthcheck:
      test: ["CMD-SHELL", "curl -f http://localhost"]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 2s
  nerdctl compose up -d
  nerdctl inspect <container-name> | grep health

opjt added 2 commits April 27, 2026 20:46
Signed-off-by: Park jungtae <jtpark1957@gmail.com>
Signed-off-by: Park jungtae <jtpark1957@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant