How to Get Docker Image from Public Docker Repository

Posted on

Introduction

Another article which has the content focusing on the usage of docker tool. Specifically, this article will show how to get docker image from a public docker repository. Basically, the command for the execution is very simple. But in order to get the correct docker image from the public docker repository, there must be another command execution before. This article will show about the requirement and also the sequence step of the command execution.

How to Get Docker Image from Public Docker Repository

Actually, before getting on to the command for getting the docker image from public docker repository, there are several things which is very important to focus on. In this case as an example, the following is the existing requirements for the command to be able to run properly :

  1. The first one is the machine which is using Microsoft Windows 10 operating system. There can be another type of operating system. But the most important thing for that operating system is the support of the docker tool to run on top of it.

  2. Next step, install docker version which is compatible with the operating system. In order to do that, just access the Docker official website in this link.

  3. Following after, make sure that the docker tool command is available. In order to do that, run the Command Prompt as an Administrator account just to make sure.

  4. Type the ‘docker’ command in the command prompt. If it is working, before getting the docker image from the public docker repository, do not forget to search it first. An article for informing on how to search a docker image exist in this link. It is an article with the title of ‘How to Search a Docker Image in a Docker Repository’ in this link. Just execute the ‘docker’ command to get the docker image from the public docker repository as in the following example :

    C:\mydocker-build>docker search centos
    NAME                               DESCRIPTION STARS OFFICIAL AUTOMATED
    centos                             The official build of CentOS. 6957 [OK]
    ansible/centos7-ansible            Ansible on Centos7 135 [OK]
    consol/centos-xfce-vnc             Centos container with "headless" VNC session… 132 [OK]
    jdeathe/centos-ssh                 OpenSSH / Supervisor / EPEL/IUS/SCL Repos - … 121 [OK]
    centos/systemd                     systemd enabled base container. 105 [OK]
    centos/mysql-57-centos7            MySQL 5.7 SQL database server 92
    imagine10255/centos6-lnmp-php56    centos6-lnmp-php56 58 [OK]
    tutum/centos                       Simple CentOS docker image with SSH access 48
    centos/postgresql-96-centos7       PostgreSQL is an advanced Object-Relational … 45
    centos/httpd-24-centos7            Platform for running Apache httpd 2.4 or bui… 40
    kinogmt/centos-ssh                 CentOS with SSH 29 [OK]
    centos/mariadb                     22 [OK]
    guyton/centos6                     From official centos6 container with full up… 10 [OK]
    centos/tools                       Docker image that has systems administration… 7 [OK]
    drecom/centos-ruby                 centos ruby 6 [OK]
    mamohr/centos-java                 Oracle Java 8 Docker image based on Centos 7 3 [OK]
    darksheer/centos                   Base Centos Image -- Updated hourly 3 [OK]
    amd64/centos                       The official build of CentOS. 2
    dokken/centos-7                    CentOS 7 image for kitchen-dokken 2
    miko2u/centos6                     CentOS6 日本語環境 2 [OK]
    blacklabelops/centos               CentOS Base Image! Built and Updates Daily! 1 [OK]
    mcnaughton/centos-base             centos base image 1 [OK]
    starlabio/centos-native-build      Our CentOS image for native builds 0 [OK]
    jelastic/centosvps                 An image of the CentOS Elastic VPS maintaine… 0
    smartentry/centos                  centos with smartentry 0 [OK]

    C:\mydocker-build>

    The above searching process is looking for an image with the name of ‘centos’ in the public repository. There are many of them but the main one is the official build of Centos with the name of ‘centos’. So, continue to the next step to get or to pull the image.

  5. Finally, get the ‘centos’ image with the following command :

    C:\mydocker-build>docker pull centos
    Using default tag: latest
    latest: Pulling from library/centos
    a1d0c7532777: Already exists Digest: sha256:a27fd8080b517143cbbbab9dfb7c8571c40d67d534bbdee55bd6c473f432b177
    Status: Downloaded newer image for centos:latest
    docker.io/library/centos:latest
    
    C:\mydocker-build>
    
  6. Last but not least, execute the following command to check for the already pulled image as follows :

    C:\mydocker-build>docker image list --all
    REPOSITORY                         TAG    IMAGE ID     CREATED      SIZE
    mydockerapp                        latest e1d4421cfe4b 20 hours ago 1.04GB
    docker101tutorial                  latest 7f8109362ad3 3 weeks ago  28.5MB
    hub.docker.local:5000/local-alpine latest c059bfaa849c 5 weeks ago  5.59MB
    alpine/git                         latest c6b70534b534 6 weeks ago  27.4MB
    registry                           latest b8604a3fe854 7 weeks ago  26.2MB
    centos                             latest 5d0da3dc9764 3 months ago 231MB
    hello-world                        latest 22773018c042 3 months ago 231MB
    hub.docker.local:5000/hello-world  latest 22773018c042 3 months ago 231MB
    
    C:\mydocker-build>
    

    As seen in the above output of the command execution, there is an image with the name of ‘centos’ exist. In that case, the process for downloading or pulling the image with the name of ‘centos’ is a success.

Leave a Reply