---
title: "Validate Healthcheck Instruction"
diataxis: reference
applies_to:
  product: "kyverno"
audience: ["platform-engineer","devsecops"]
last_updated: 2026-03-25
url: https://docs.nirmata.io/docs/policy-sets/dockerfile_best_practices/validate-healthcheck-instruction/
---


### Description

Ensuring the presence and proper configuration of the `HEALTHCHECK` instruction in a Dockerfile is crucial for maintaining the health and stability of containerized applications. This policy aims to validate whether the `HEALTHCHECK` instruction is appropriately defined to promote robust container orchestration and monitoring practices.

### Kyverno policy

Refer to the Nirmata curated policies - [validate-healthcheck-instruction](https://github.com/nirmata/kyverno-policies/blob/main/dockerfile-best-practices/validate-healthcheck-instruction/validate-healthcheck-instruction.yaml).

### Resource example

Below is an example of a Dockerfile enforcing this policy.

```bash
FROM ubuntu:latest

HEALTHCHECK CMD curl --fail http://localhost:80 || exit 1

CMD ["nginx", "-g", "daemon off;"]
```text

