Docker Hub Registry - Free Alternatives
Docker Hub Registry - Free Alternatives

In this post I want to share with you my alternatives that I'm using for Docker Hub.

If you are learning or using Docker at some point you know about Docker Hub. What is it? It is a special service where you can upload your images.

Docker hub

This is the official service from the Docker itself this is why it is extremely popular. But the main problem is that it is not a free tool.

Pricing

As you can see it is free only for public repositories. It is not free for private repositories which means if you have some images that you don't want to make public this is not a good choice for you. Or you must pay at least $5 per month to get unlimited private repositories.

I really want to store all my images privately and not for public. This is why there are some alternatives that I'm using.

Gitlab & Container Registry

And the first alternative here in the list is Gitlab and Container Registry.

Gitlab containers

When you make a free account inside Gitlab you have access to a container registry. You can upload inside Gitlab (inside your repository) your images of the Docker. This is exactly what I have here for my own website.

The main point is that in Gitlab you are getting 10 GB of data for free. This are data for everything in your repository. For your files but also in this case for Docker images. And this is extremely efficient and completely free. You just push your image from local to Gitlab and inside other machines (for example in your production server) you can just pull your image and use it there.

Now you for sure think but Github has the same stuff. Why do I need Gitlab. Actually inside Github Docker Container Registry is only free for public images. Which means it is the same as Docker Hub. You can just from everything publicly and it is not interesting for us.

Building on server

But actually there is another way. To understand it we must ask ourselves "Why do we need a place to store Docker images?". First of all it is a comfort of possibility to pull this image on any machine. Secondly your server might be not that fast to build an image itself or it is lacking the space.

If your server is not extremely cheap you can build all your Docker images just like you are doing locally for your production application. What is the idea?

git pull
docker-compose build
docker-compose up -d

On the production server I just pull the project from Gitlab without any Docker images. As docker and docker-compose are installed on my production server I can just build the image from scratch there and start the container.

So instead of using some external registry you just pull your latest project changes and rebuild image directly on production server.

And actually if you want to learn how to setup Docker from empty folder to a fully functional deployed application make sure to check Docker and Docker Compose - Project Deployment From Scratch.