Docker Pull and Images
docker pull downloads an image from a registry, and a tag names one version of it. The image ID is the image's fingerprint, and the size shows what the download costs.
Pull an image
This command downloads the nginx image with its tag.
docker pull nginx:1.27-alpinePull a small image
hello-world is tiny, so its pull is short.
docker pull hello-world:latestExample
docker pull nginx:1.27-alpine
docker images nginx --format "{{.Repository}}:{{.Tag}} {{.Size}}"Key points
- Use docker pull to download an image before running it.
- A tag names one version, like nginx:1.27-alpine.
- latest is the tag used when no tag is given.
- An image ID is a fingerprint for one exact image build.
- Use docker images to see every image on the machine.
In this example, Docker pulls the nginx image and then lists it. The pull output names the digest and confirms the download. The listing shows the repository, the tag and the size. The size is what the download cost.
Note
Two tags can point at the same image ID. The ID is the image, and the tag is its name.
Try it Yourself
Edit the code, then press Run.
Running is simulated · Rust Playground
Exercise
What does the tag in nginx:1.27-alpine name?