How To Download Docker Images From Docker Hub In Linux?


Docker image is an immutable file that is essentially a snapshot of a container. Images are created with build command, and they produce a container when started with the run command. Docker pulls these images from the docker hub.

Docker hub maintains a registry because an image can become quite large, these are designed to be composed of other images, allowing a minimal amount of data to be sent when transferring images over the network.

This article describes how to download and use the docker image from the docker hub in Linux.

Docker Hub

Docker provides a service called docker hub which allows users to find and share container images with their team. It has various features such as you can manage access to private repositories of container images, automatically build container images from GitHub, Bitbucket and push them to docker hub, etc. Docker officially provides high-quality docker images.

How to search for an image

Before you start performing operations such as searching and downloading docker images you need to download and install docker in your system. Once it gets installed you can use the search command with the docker to find an image.

sudo docker search alpine

This will display the list of images available with the name alpine in the docker hub. Here you can identify the image that you want to download.

How to download a docker image

Now use the pull command to download an image from docker hub  –

sudo docker pull alpine

This will start downloading the image of alpine Linux from the docker hub.

How to list all the downloaded images

To display the list of local images you need to use the following command –

sudo docker images

You can see the downloaded docker images in the above image.

Conclusion

Ok, that’s all for now. If you want to know more about the options and commands that can be used with the docker then run docker command without any argument. Or you can also display the commands by executing man docker in your terminal.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.