Docker

How to Pull Docker Image From Private Registry

Docker images are the major part of the Docker development platform used to build the container. These images contain information that guides containers on managing and deploying the project. Docker provides the official registry “Docker Hub”, which contains thousands of images for Docker users. Users can easily pull them for use. Some developers build their own private registry to publish and manage project images for personal use.

This write-up will discuss pulling an image in Docker from a private registry.

How to Pull Image From Docker Private Registry?

Pulling Docker images means downloading images from any source or registry. For pulling an image in Docker from a private registry, first, users are required to start the registry container. Then, log in to their private registry and pull the Docker image.

For this purpose, go through the listed instructions.

Step 1: Log in to Private Registry

To log in to a Docker private registry, utilize the provided command. For instance, we have logged in to our private registry operating on “localhost:5000”:

> docker login localhost:5000

Note: Before logging in to the private registry, users must start the registry container.

Step 2: Visit Registry Catalog

Next, navigate to the local registry catalog using the “<domain/v2/-catalog>” URL. As our registry is operating on “localhost:5000”, therefore, we have used the “localhost:5000/v2/_catalog” URL. The registry catalog will display all available images:

Step 3: Pull Image From Private Repository

Next, pull the Docker image from the private registry using the “docker pull <source-registry>/<image-name>:tag” command:

> docker pull localhost:5000/alpine-img

Step 4: Verification

Next, list down all Docker images to confirm if the required image is pulled or not. To do so, use the mentioned command:

> docker images

It can be noticed that we have successfully pulled the Docker image from a private registry.

Conclusion

To pull the Docker image from a private registry, users are required to start the registry container. Then, log in to the private registry. After that, utilize the “docker pull <image-name>” command to pull the Docker image from Docker private registry. This blog has illustrated the method for pulling an image from a Docker private registry.

About the author

Rafia Zafar

I am graduated in computer science. I am a junior technical author here and passionate about Programming and learning new technologies. I have worked in JAVA, HTML 5, CSS3, Bootstrap, and PHP.