Knowing Docker Hub

Learn what Docker Hub is, how pushing images helps, and what alternatives you can use.

Docker Hub

For the most part, Docker Hub is to Docker what Github is to Git.

You will primarily use Docker Hub to locate and use application images like Apache, PHP, Node.js, Python, MySQL, or MongoDB. However, it’s also possible to push your own application images to Docker Hub.

Why push an image to Docker Hub?

In reality, many developers never will. Your Dockerfile can be added to any project repository to build an application image during development or as part of a production deployment process.

However, pushing an image to Docker Hub offers several benefits:

  1. It is easier to distribute a pre-built and tested image with your team.

  2. The image can be pulled on production servers. Deployment is simpler and faster because the image has already been built.

  3. A published image can be used by anyone. Your application can be shared with users, clients, and other developers throughout the world.

Docker Hub allows you to create any number of public repositories. These appear in search results and can be used by anyone. But remember you will be distributing your application’s source code.

You can also create one private repository and purchase more if necessary. Access to private repositories can be granted to named organizations and individual Docker Hub users.

📌 You can make your Docker Hub account here.

Docker Hub alternatives

As well as Docker Hub, there are plenty of alternative hosted and self-hosted container registries. All provide private repositories with varying price points:

This chapter uses Docker Hub, but the process is similar to other repositories. Typically, you will log into a different system and/or specify a URL when pushing the image.

Get hands-on with 1200+ tech skills courses.