The Docker pull command is used for downloading Docker images from the Docker Hub or private registry.
The basic syntax to pull the Docker image from the Docker Hub as shown below:
docker pull [OPTIONS] NAME[:TAG|@DIGEST]
For example, to pull the Ubuntu 20.04 Docker image from the Docker Hub, run the following command:
docker pull ubuntu:20.04
returns:
20.04: Pulling from library/ubuntu 6a5697faee43: Pull complete ba13d3bc422b: Pull complete a254829d9e55: Pull complete Digest: sha256:fff16eea1a8ae92867721d90c59a75652ea66d29c05294e6e2f898704bdb8cf1 Status: Downloaded newer image for ubuntu:20.04 docker.io/library/ubuntu:20.04
docker images
returns
REPOSITORY TAG IMAGE ID CREATED SIZE ubuntu 20.04 d70eaf7277ea 12 days ago 72.9MB