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

> Do not refer to an undefined variable.

Do not refer to an undefined variable.

> **Superseded by [`buildkit/UndefinedVar`](../buildkit/UndefinedVar)**, which provides the same check with typo detection.

## Description

Ensures that environment variables and build arguments are declared before being used. Undeclared variables can lead to unexpected behavior or build
errors.

## Examples

### Problematic code

```dockerfile theme={null}
FROM alpine
COPY $foo .
```

### Correct code

```dockerfile theme={null}
FROM alpine
ARG foo
COPY $foo .
```

## Reference

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