> ## Documentation Index
> Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# hadolint/DL3059

> Multiple consecutive `RUN` instructions.

Multiple consecutive `RUN` instructions.

> **Superseded by
> [`tally/prefer-run-heredoc`](../tally/prefer-run-heredoc)**,
> which provides the same check with enhanced detection
> (consecutive RUNs and chained commands) and auto-fix support
> using heredoc syntax.

## Description

Multiple consecutive `RUN` instructions can be consolidated into a single instruction to reduce image layers.

## Examples

### Problematic code

```dockerfile theme={null}
FROM ubuntu
RUN apt-get update
RUN apt-get install -y curl
```

### Correct code

```dockerfile theme={null}
FROM ubuntu
RUN apt-get update && apt-get install -y curl
```

Or with heredoc syntax (tally auto-fix):

```dockerfile theme={null}
FROM ubuntu
RUN <<EOF
apt-get update
apt-get install -y curl
EOF
```

## Reference

* [hadolint/DL3059](https://github.com/hadolint/hadolint/wiki/DL3059)
