Docker Pull Command
# Docker pull Command
[Docker Command Manual](#)
* * *
The `docker pull` command is used to pull (download) images from a Docker registry (such as Docker Hub) to the local machine.
The `docker pull` command allows users to obtain the desired images to run containers locally.
### Syntax
docker pull NAME[:TAG|@DIGEST]
* **`NAME`**: The image name, which usually includes the registry address (e.g., `docker.io/library/ubuntu`).
* **`TAG`** (optional): The image tag, defaulting to `latest`.
* **`DIGEST`** (optional): The SHA256 digest of the image.
Common options:
* **`--all-tags, -a`**: Download all tags for the specified image.
* **`--disable-content-trust`**: Skip image signature verification.
**1. Pull an image with the default tag (latest)**
docker pull ubuntu
This pulls the image named `ubuntu` from Docker Hub, with the default tag `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 an image with all tags**
docker pull --all-tags ubuntu
This pulls all available tags for 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`.
### Examples
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 a specific tag of the Ubuntu image
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
* The default tag is `latest`, but it's best to explicitly specify a tag to avoid pulling an unintended version.
* Ensure you have enough disk space to store the pulled images.
* In production environments, it is recommended to use the image digest to ensure the uniqueness and consistency of the image.
The `docker pull` command is a fundamental tool for obtaining Docker images. By specifying the image name, tag, or digest, you can download the required images from a Docker registry.
* * Docker Command Manual](#)
YouTip