docker pull
The docker pull command is used to download Docker images from a registry, such as Docker Hub. This command fetches the specified image and its layers from the registry and stores them in your local Docker host.
Basic Syntax
Key Options and Parameters
--all-tags, -a: Download all tagged images in the repository.
docker pull -a ubuntu--disable-content-trust: Skip image verification (default is true).
docker pull --disable-content-trust ubuntu
Examples
Pulling a Specific Image
docker pull nginxThis command pulls the latest version of the
nginximage from Docker Hub.Pulling a Specific Tag
docker pull ubuntu:20.04This command pulls the
ubuntuimage with the tag20.04.Pulling All Tags
docker pull -a ubuntuThis command pulls all available tags of the
ubuntuimage.Pulling an Image by Digest
docker pull ubuntu@sha256:12345abcde...This command pulls the
ubuntuimage with the specified digest.
Conclusion
The docker pull command is essential for downloading images from a registry to your local Docker host. Understanding its options and parameters allows you to effectively manage and retrieve Docker images based on your needs.