docker pull
Download an image from a registry (Docker Hub by default). Does not run the image.
Syntax
docker pull [OPTIONS] NAME[:TAG|@DIGEST]
Examples
Example 1
docker pull nginx
Pull latest nginx from Docker Hub.
Example 2
docker pull nginx:1.25-alpine
Pull a specific tag (version and variant).
Example 3
docker pull ghcr.io/owner/repo:tag
Pull from GitHub Container Registry.
Common flags
| Flag | Description |
|---|---|
| -a, --all-tags | Download all tags for the image |
| --platform | Set platform (e.g. linux/amd64) |
Tips & best practices
- •Always pin to a specific tag in production (avoid :latest).
- •Use alpine variants for smaller images when possible.