Skip to content

Add Health Check Support in nerdctl #4157

@subashkotha

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions