---
title: "Detect Multiple Instructions"
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/detect-multiple-instructions/
---


### Description

This policy is implemented to ensure that container images are built with minimal cached layers. It specifically focuses on detecting and preventing the use of multiple instructions in a single line within Dockerfiles.

### Kyverno policy

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

### Resource example

Below is an example of a Dockerfile enforcing this policy.

```bash
FROM ubuntu:latest

# Update the package repository
RUN apt-get update

WORKDIR /app

COPY . /app

EXPOSE 8080

# Example: Run a command when the container starts
CMD ["echo", "&& is not present"]
```text

