A Docker registry is a system that stores and distributes Docker images. There are many images hosted on a registry hub. One image can have multiple versions, each identified by a different tag.

A registry lets users pull Docker images from it and push new images to it for hosting. This allows you to have a copy of your application online. It also enables you to share the images with others.

Find out everything you need to push an image of an application to the Docker registry.

Why Use Docker Registry?

Although there are many public registries online, DockerHub is very popular. The Docker registry is a product of Docker Inc, the company responsible for the Docker platform itself. It hosts both public and private repositories. You can use public repositories or pay for restricted private repositories.

The Docker registry provides automated builds, corporate accounts, and source control integration. The setup is much like GitHub, the collaborative open-source platform. The Docker engine interacts with the Docker registry by default. You can also run your CI/CD processes.

You can learn more about the Docker registry by deploying a demo app.

Create a Docker Registry Account

Start by navigating to the Docker Hub website and registering an account there.

Docker HUb registration page

Once you've signed up and logged in you will have access to your Docker account.

inside new Docker account

You need to create a repository to push a demo app image to. Click on the Create repository button, then provide a Name and Description of the repository. You can choose whether to make your repository public or private. The Docker registry gives you access to one free private repository and multiple public ones.

create repository on Docker Hub

Pull a Docker Image

To test the process, pull a sample Docker Image from Docker Hub. You can pull an Ubuntu image using this command:

        docker pull ubuntu
    

Ubuntu is one of the official Docker images. Next, you need to push it into your own Docker repository.

Push Your Image to the Docker Registry

You must now push the image from your local machine to the Docker Hub repository. All repositories contain instructions on how to push images into them. You'll need to use this specific syntax to structure your local image before pushing it to your repository. It should appear like this:

repo instructions on how to push docker image

Change the name of the image in your local repo to have the same name as the command on the remote repository. You can do this with the following command:

        docker tag ubuntu:latest  sandra35/testrepo:latest
    

When the process is complete, you should see the image with the new name and tag among your images.

Then go ahead and push the image to the registry with the following command:

        docker push sandra35/testrepo:latest
    

A successful push will look like so:

successful  push to docker registry

Now, navigate to your remote Docker repository in your browser. You should see the image in the repository when you refresh the page.

successful image push to docker registry

Congratulations, you have successfully hosted an image on the Docker registry! You can check the app logs by clicking on the image.

Using the same method, you can host your own applications. The size of your application will increase the volume of the hosted image. The registry stores the image until you delete it. You can share your image with anyone on the internet.

The Docker Registry Is the Best Registry

The Docker registry is one of the great features of the Docker software system. The registry optimizes the storage and distribution of images online. You can quickly build containerized applications and ship them online.

The Docker registry hosts an unlimited number of applications on its public repositories. Alternatively, you can create paid private repositories restricted to a particular audience.

Start using the Docker registry and change the way you store and share applications.