Friday, September 18, 2020

Pulling Docker Images

In the previous post we executed the docker run command and noticed that the Docker Engine automatically pulled the hello-world image from DockerHub. We can also use the docker pull command to explicitly pull Docker images from the remote repository (DockerHub) to our local DockerRepository.

To pull images from the remote repository to the local repository we need to use the docker pull command as follows.

$ docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
Digest: sha256:7f0a9f93b4aa3022c3a4c147a449bf11e0941a1fd0bf4a8e6c9408b2600777c5
Status: Image is up to date for hello-world:latest
docker.io/library/hello-world:latest

If you are familiar with git, you can notice that these commands are similar to git pull. Git pulls source code from remote repositories to the local repository, while docker pull pulls images from remote to the local repository.

By default, docker pull pulls a single image from the registry. A repository can contain multiple images. To pull all images from a repository, provide the -a (or --all-tags) option when using docker pull

By default docker pull, pulls images from Docker Hub. It is also possible to specify a different repository path to pull images from other repositories.  To pull images from a different repository we need to specify its path. A registry path is similar to a URL, but does not contain a protocol specifier (https://)

$ docker pull <full image path>

Search Flipkart Products:
Flipkart.com

No comments: