A Simple Introduction to Docker Hub

undefined

In this article, I’ll guide you to explore the Docker world, we’ll start with Docker Hub. This is the first part you must know in the Docker world. In this article you’ll find the answers for these questions: What is the Docker Hub? – What are it’s main features? – What are the differences between private and public repositories?

Here you’ll find a simple explanation for Docker Hub, you’ll know the information you need about it. As you decided to move to Docker, it’s preferred to install Docker on your machine to explore the Docker Hub through CLI. Check the below prerequisites.

Prerequisites

Before we dive into Docker containers, we need to install the Docker daemon first. According to your Linux OS here’s our installation articles for different Linux releases:

Now, you successfully installed Docker on your Linux machine, let’s continue with the introduction to Docker Hub.

Part 1: Exploring the Docker Hub Repositories

Let’s start with the basic question,  What is Docker Hub?

Docker Hub is a cloud-based registry service which allows you to link to code repositories, build your images and test them, stores manually pushed images, and links to Docker Cloud so you can deploy images to your hosts. It provides a centralized resource for container image discovery, distribution and change management, user and team collaboration, and workflow automation throughout the development pipeline.

Simply, Docker hub is a cloud register you will use to pull images “official or user’s images”, store/push your images to it to use it later. Docker hub stores multiple version of  each image in a separate repository, it uses a naming convention image_name:tag to differentiate between different version of an image, if you don’t provide a tag when you pull/push image from/to a repository, it will use latest as a tag for this image. In Docker hub you can find two types of repositories Public and Private. Public repositories can be either official “created by organizations” or non-official “creates by users”. Private repositories is a non-official repositories created by users or companies for using within a private groups/teams.

Part 2: Docker Hub Major Features:

Here’s the main features Docker Hub provides:

  • Image Repositories: Find and pull images from community and official libraries, and manage, push to, and pull from private image libraries to which you have access.
  • Automated Builds: Automatically create new images when you make changes to a source code repository.
  • Webhooks: A feature of Automated Builds, Webhooks let you trigger actions after a successful push to a repository.
  • Organizations: Create work groups to manage access to image repositories.
  • GitHub and Bitbucket Integration: Add the Hub and your Docker Images to your current workflows.

Part 3: Differences between Private and Public Repositories:

Explore repositories

You can find public repositories and images from Docker Hub in two ways. You can “Search” from the Docker Hub website, or you can use the Docker command line tool to run the docker search command. For example if you were looking for an CentOS image, here’s the Docker hub web site results:

undefined

 

As you see, we have 13796 public repositories, the first one is the official one, the others are users repositories. Exploring the Docker hub website is not the ideal case

Ideally, you’ll use the following command line search to explore Docker hub repositories, here’s the search results for CentOS:

    $ docker search CentOS

undefined

As you see, the first one is the official one, the others are users repositories.

Both methods list the available public repositories on Docker Hub which match the search term.

Private repositories do not appear in the repository search results. To see all the repositories you can access and their status, view your “Dashboard” page on Docker Hub.

Use Official Repositories

Docker Hub contains a number of Official Repositories. These are public, certified repositories from vendors and contributors to Docker. They contain Docker images from vendors like Canonical, Oracle, and Red Hat that you can use as the basis to building your applications and services.

With Official Repositories you know you’re using an optimized and up-to-date image that was built by experts to power your applications.

Before moving to the next part, you may want to create your Docker ID, Docker hub provide a free ID for users with unlimited Public repositories and only one private repository, if you need more private repositories, you can upgrade your Docker ID and of course pay a monthly fees.

Creating a Docker ID is simple as shown below:

undefined

Simply, you’ll be asked for a username, and email, and a password. Now let’s proceed to the next part.

Hints:

1. You do not need to have a Docker ID to explore the public repositories.

If You Appreciate What We Do Here On Mimastech, You Should Consider:

  1. Stay Connected to: Facebook | Twitter | Google+
  2. Support us via PayPal Donation
  3. Subscribe to our email newsletters.
  4. Tell other sysadmins / friends about Us - Share and Like our posts and services

We are thankful for your never ending support.

One Comment to A Simple Introduction to Docker Hub

  1. Moustafa Sallam says:

    Great Article

Leave a Reply

Your email address will not be published. Required fields are marked *