How to search for a container image

by Daniel Pham
Published: Updated:
This entry is part 3 of 4 in the series Instructions for installing and using the Docker

This article will show you how to search for a container image. Thereby you will get the image you need to launch the container.

Docker Hub

First, I have to talk about Docker Hub. This is a huge Docker library; it contains image containers here and allows you to download.

Docker Hub is a place for you to manage your image containers (or the team). It allows you to create images, upload and download images.

docker hub library
Docker Hub library.

Temporarily, we’re not going to talk about how to create and upload images to Docker Hub, but we just stop figuring out how to find an image we need to use.

Search directly on the Docker Hub website

Okey, now you know the Docker Hub library. We will have the first way to go directly to the website and search for the image we need.

For example, I need a CentOS image, I will type centos in the search box on the website.

search centos image in docker hub
Search centos image in Docker Hub.

As a result, notice that the images are labeled OFFICIAL IMAGE. These are genuine images for all users. You should use it because it ensures clean images, does not contain underground viruses.

Here, I click on the first result, centos official image. Next I need to select the tag. You can understand the tag here is the different versions of the image that the provider creates. For example: centos 6, centos 7, … if you don’t know the version, you can choose latest.

select tag of image
Select tag of image.

For example, here I will choose CentOS with the tag of 7.6.1810. And now, look to the right of the screen, you will see the following command:

docker pull centos

This is the command to download the image to your computer. Now type that command and include the selected tag.

docker pull centos:7.6.1810

Search through the docker command

There is another way you can find the images you need, no need to visit the website. That is to use the docker command.

Docker has a search command that allows you to search for images directly from Docker Hub.

Type the search image centos command as follows.

docker search centos

And the result will show up as follows.

user docker search command to search centos image
User docker search command to search centos image.

Now, you can also use the pull command to download the image you need to your computer.

docker pull centos:7.6.1810

Look like this.

root@linux:~# docker pull centos:7.6.1810
7.6.1810: Pulling from library/centos
ac9208207ada: Pull complete 
Digest: sha256:6ae4cddb2b37f889afd576a17a5286b311dcbf10a904409670827f6f9b50065e
Status: Downloaded newer image for centos:7.6.1810

Check the downloaded image

Now you can check the images that you downloaded to the computer using the command below.

root@linux:~# docker image list
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
centos              7.6.1810            f1cb7c7d58b7        6 weeks ago         202MB
centos              7                   9f38484d220f        6 weeks ago         202MB
ubuntu              16.04               7e87e2b3bf7a        3 months ago        117MB

So you have successfully downloaded image centos 7.6.1810 on your device.

Conclusion

In this article, there is no difficult technique. It is simply a tutorial that shows you how to find the image container you need. This is the first step you need to learn, you can’t create the necessary containers if you don’t know how to find the image.

(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).

0 0 votes
Article Rating
Series Navigation«« Previous part: How to install Docker on Linux Mint 18Next part: How to list the tag of a container image »»

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

2
0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.