Docker Hub is a service provided by Docker for hosting, searching, and sharing container images. In DevOps, the deployment of any application in Docker begins with a Docker image. These Docker images are placed in Docker Hub or any third-party registry like AWS ECR, GitHub, or IBM registries. Just like git repo hosting services, a Docker repository can be public or private. Docker Hub is the world’s largest repository of container images. Not only that, Docker Hub also provides major features like Repositories, official and publisher images, builds, web hooks, teams, and organization.
If you want to know more about Docker, go through the following articles:
Let’s take a deep dive and explore more about Docker Hub.
We will use these terms extensively in our tutorials and upcoming guides. Therefore, it is necessary to understand the key differences between a registry and a repository.
The simplest difference is:
A registry stores a collection of repositories.
A repository contains images with different tags.
So, the Docker Hub is a registry where you will create a repository to store the images.
You can even host a registry by yourself. Also, it could be hosted by a third-party registry provider like:
It’s your choice to host images wherever you want. There would be a difference between the repository and tags but you can pull the images with the same command.
There are over 100K container images on Docker Hub from open-source projects, software vendors, and the community. These images serve as the starting point for the users to build customized images. You’ll find every official image here like Ubuntu, MySQL, NGINX, Alpine, CentOS, etc. There is a dedicated team that is responsible for reviewing and publishing all content in the Official Images. These images are scanned and safe to pull and run.
Since we are new to Docker, it is strongly recommended to use the official images to learn about Docker. We’ll also build the images with customizations with the help of Dockerfile but it is for advanced users. As a beginner, we will use these official images to build, run and deploy the applications.
You’ll receive an email to activate the account. Click on the verify email address button to verify the account.
In the next step, Docker Hub will ask us to choose the plan. There are currently three plans, Free, Pro, and Team. Choose the Free plan and click on continue with the free plan.
On the Docker Hub dashboard, you can see we don’t have any repositories created yet. So, we are going to create the first repository and that would be public. We can create unlimited repositories in the free plan.
Click on Repositories ==> Create Repository
Creating a public repository on Docker Hub is simple and easy. Follow the below steps.
The public repository has been created. You can see the public view button which means the images in this repository can be pulled from anyone in the world using the below command.
docker pull softwarespice/devimages
We’ll discuss pulling a docker image in detail, so there is nothing to worry about.
We can only create ONE private repository in the free plan on hub.docker.com. If you want more, you need to choose the Pro or Team plan. By the way, a single private repository is enough to learn how private repositories work and we can push images to them.
Images in the private repository can only be pulled or pushed by you or the person whom you have shared the credentials with.
There are no big differences while creating a private repository. We need to check the private button instead of the public. Here are the steps:
We have created our private repository. As I said earlier, we can create only one repository in the free plan.
Finally, you can see both repositories under Repositories. There are no pushes or pulls since we didn’t push or pull any image yet.
The repositories will be updated when we’ll start the pushing and pulling drills.
Stay tuned and Happy Docking!