Skip to content

feat: support healthcheck field in service config - #4869

Merged
AkihiroSuda merged 2 commits into
containerd:mainfrom
opjt:feat/healthcheck
May 15, 2026
Merged

AkihiroSuda merged 2 commits into
containerd:mainfrom
opjt:feat/healthcheck

Conversation

@opjt

@opjt opjt commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

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

opjt commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi, just following up on this PR. Thanks!

@AkihiroSuda AkihiroSuda added this to the v2.3.1 milestone May 10, 2026
@opjt opjt changed the title compose: support healthcheck field in service config feat: support healthcheck field in service config May 10, 2026
@opjt
opjt force-pushed the feat/healthcheck branch 4 times, most recently from 9221952 to 6c186d2 Compare May 11, 2026 12:44
@opjt
opjt requested a review from haytok May 11, 2026 12:55
opjt added 2 commits May 12, 2026 07:56
Signed-off-by: Park jungtae <jtpark1957@gmail.com>
Signed-off-by: Park jungtae <jtpark1957@gmail.com>
@opjt
opjt force-pushed the feat/healthcheck branch from 6c186d2 to e51bc85 Compare May 11, 2026 23:02
@opjt
opjt requested a review from haytok May 11, 2026 23:06

@haytok haytok left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

@haytok
haytok requested a review from AkihiroSuda May 12, 2026 14:04

@AkihiroSuda AkihiroSuda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda
AkihiroSuda merged commit ca625ef into containerd:main May 15, 2026
92 of 100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants