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

> Invalid instruction order. Dockerfile must begin with `FROM`, `ARG` or comment.

Invalid instruction order. Dockerfile must begin with `FROM`, `ARG` or comment.

| Property | Value |
| - | - |
| Severity | Error |
| Category | Correctness |
| Default | Enabled |

## Description

A Dockerfile must begin with a `FROM` instruction, an `ARG` instruction, or a comment. Any other instruction before `FROM` will cause a build error.

## Examples

### Problematic code

```dockerfile theme={null}
COPY . /foobar
```

### Correct code

```dockerfile theme={null}
FROM scratch
COPY . /foobar
```

## Reference

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


## Related topics

- [tally/require-stages](https://tally.wharflab.com/rules/tally/require-stages.md)
- [Hadolint rules](https://tally.wharflab.com/rules/hadolint/overview.md)
- [hadolint/DL3000](https://tally.wharflab.com/rules/hadolint/DL3000.md)
- [hadolint/DL3001](https://tally.wharflab.com/rules/hadolint/DL3001.md)
- [hadolint/DL3002](https://tally.wharflab.com/rules/hadolint/DL3002.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.