Skip to main content

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:latest

2. A specific tag:

bash
docker pull nginx:1.25

3. From a private registry:

bash
docker login my-registry.com # log in first docker pull my-registry.com/app/api:2.0

How to verify the image was pulled

bash
docker images

The 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 ready
Premium

A concise answer to help you respond confidently on this topic during an interview.