Skip to content

Add Health Check Support in nerdctl #4157

Closed

Description

@subashkotha

What is the problem you're trying to solve

Docker provides built-in support for container health checks through its daemon, allowing users to monitor container health and take automated actions like restarts. nerdctl currently lacks native health check support, which limits its ability to support similar workflows—especially when running containers defined via Dockerfiles or Compose files that include health check instructions. This feature aims to close that gap by enabling health checks in a way that aligns with nerdctl’s daemonless design.

Describe the solution you'd like

We’d like to propose adding health check support in nerdctl, similar to what Docker offers, but designed to work in nerdctl’s daemonless architecture. This feature will enable users to define and run application-level health checks using:

  1. Docker-compatible CLI flags (e.g., --health-cmd, --health-interval, etc.)
  2. Health check configuration defined in Dockerfiles (HEALTHCHECK instruction)
  3. Health checks defined in Compose files

As part of this support, we will introduce a new subcommand:

nerdctl healthcheck run <container>

This command acts as the entry point for performing the health check—it runs the configured health check command inside the container and determines the result.

Since nerdctl does not have a persistent daemon like Docker, we use systemd to invoke this command at the configured intervals, effectively handling the scheduling aspect externally.

Related discussion - #4032

Additional context

No response

Activity

  1. swagatbora90 commented on Apr 24, 2025

    @swagatbora90
    Contributor
  2. added this to the v2.2.0 (?) milestone on May 2, 2025
  3. apostasie commented on Jun 23, 2025

    @apostasie
    Contributor

    Is this complete with #4302?

  4. swagatbora90 commented on Jun 24, 2025

    @swagatbora90
    Contributor

    [#4302] only adds support for healthcheck option in nerdctl run, nerdctl create, and introduces a new nerdctl container healthcheck command. However, periodic execution of health checks against running containers is still WIP.

    This issue tracks the overall healthcheck support in nerdctl, so we should keep it open.

  5. swagatbora90 commented on Sep 24, 2025

    @swagatbora90
    Contributor

    This issue can be closed now since both the healthcheck command implementation and orchestration PRs are merged now.

  6. tom-rm-meyer-ISST commented on Sep 25, 2025

    @tom-rm-meyer-ISST

    This issue can be closed now since both the healthcheck command implementation and orchestration PRs are merged now.

    Cool, if I see things correctly, this is part of version 2.1.3, isn't it?

  7. swagatbora90 commented on Sep 25, 2025

    @swagatbora90
    Contributor

    Healthcheck command was added in 2.1.3. Orchestration PR was recently merged #4427 and will be available in the next 2.1.5 release.

  8. removed this from the (revisit in future) milestone on Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions