How to pull a Docker image from a registry?
To pull a Docker image from a registry, the docker pull command is used.
General format:
javascript
docker pull <registry>/<repository>:<tag>Examples of the docker pull command
1. From Docker Hub (the registry can be omitted):
bash
docker pull nginx:latest2. A specific tag:
bash
docker pull nginx:1.253. From a private registry:
bash
docker login my-registry.com # log in first
docker pull my-registry.com/app/api:2.0How to verify the image was pulled
bash
docker imagesThe downloaded image appears in the list.
Summary: to pull an image, use docker pull, specifying the repository and tag. After that, the image can be run with docker run.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.