Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Docker pull Command

Docker pull Command

Docker Command ReferenceDocker Command Reference


docker pull The command is used to pull (download) images from a Docker registry (such as Docker Hub) to the local machine.

docker pull The command allows users to obtain the required images to run containers locally.

Syntax

docker pull [OPTIONS] NAME[:TAG|@DIGEST]

Common options:

** 1. Pull an image with the default tag (latest)**



docker pull ubuntu

This pulls the image named ubuntu from Docker Hub, with the tag defaulting to latest.

** 2. Pull an image with a specific tag**



docker pull ubuntu:20.04

This pulls the image named ubuntu from Docker Hub with the tag 20.04.

** 3. Pull an image with a specific digest**



docker pull ubuntu@sha256:12345abcdef...

This pulls the ubuntu image with a specific SHA256 digest.

** 4. Pull all tags of an image**



docker pull --all-tags ubuntu

This pulls all available tags of the ubuntu image.

** 5. Pull an image from a custom registry**



docker pull myregistry.com/myrepo/myimage:mytag

This pulls the myimage image from the myrepo repository in the myregistry.com registry, with the tag mytag.

Example

1. Pull the Ubuntu image:



docker pull ubuntu

Example output:



Using default tag: latest

latest: Pulling from library/ubuntu

Digest: sha256:12345abcdef...

Status: Downloaded newer image for ubuntu:latest

docker.io/library/ubuntu:latest

2. Pull the Ubuntu image with a specific tag



docker pull ubuntu:20.04

Example output:



20.04: Pulling from library/ubuntu

Digest: sha256:67890abcdef...

Status: Downloaded newer image for ubuntu:20.04

docker.io/library/ubuntu:20.04

Notes

docker pull The command is a basic tool for obtaining Docker images; by specifying an image name, tag, or digest, you can download the required image from a Docker registry.


Docker Command ReferenceDocker Command Reference