TL;DR: Lowercase the image name. `docker build -t MyApp:latest` becomes `docker build -t myapp:latest`, and the same for tag, push, and run. Docker Hub namespaces and repository names are lowercase-only by rule, and the daemon enforces it at parse time.

## The error

```text
invalid reference format: repository name must be lowercase
```

## Fix it

1. Lowercase the repository portion (everything before the `:tag`):
   `docker tag MyApp:latest myregistry/myapp:latest`
   Expected: succeeds.
2. If the name comes from a CI variable (repo name, branch), normalize it in the pipeline, e.g. pipe through a lowercase transform before passing to docker.
3. Re-run the original command with the lowercased name.

## When this applies
- Any docker command failing with this exact message
- GitHub org/repo names with capitals interpolated into image tags in CI

## When this does NOT apply
- Generic "invalid reference format" with no lowercase mention (different bad character)
- Push rejections from the registry after the name parsed fine (auth/permission instead)

## Versions
All Docker versions.

## Why it happens
The distribution spec defines repository names as lowercase. The daemon validates the reference before contacting any registry, so even purely local builds fail fast on uppercase.

## Edge cases
- The TAG portion may contain uppercase (`myapp:MyTag` is legal); only the repository name must be lowercase.
- `docker pull MyApp` fails the same way even though you are only reading; validation happens client-side first.
