> ## 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/DL4003

> Multiple `CMD` instructions found.

Multiple `CMD` instructions found.

> **Superseded by
> [`buildkit/MultipleInstructionsDisallowed`](../buildkit/MultipleInstructionsDisallowed)**,
> which covers duplicate `CMD`, `ENTRYPOINT`, and `HEALTHCHECK`
> instructions with auto-fix support.

## Description

If more than one `CMD` instruction is listed, only the last one takes effect.

## Examples

### Problematic code

```dockerfile theme={null}
FROM alpine
CMD echo "first"
CMD echo "second"
```

### Correct code

```dockerfile theme={null}
FROM alpine
CMD echo "second"
```

## Reference

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