Goglides Dev 🌱

Prason Pandey
Prason Pandey

Posted on

Setup Your Own Docker registry

Docker Registry

Docker registries are systems for storing and distributing Docker images. Multiple versions of the same Docker image can be uploaded to the Docker registry.

There are many free and paid Docker Registry, which are as follow:

  1. Docker Hub
  2. Azure Container Registry
  3. Google Container Registry
  4. Google Artifact Registry
  5. Amazon EC2 Container Registry
  6. Bintray.io/Artifactory
  7. Quay.io

But, How about when you are offline and cannot access these registries?

Let's setup our own local offline accessible docker registry.

Install Docker Registry Container

First, we have to install Registry container from docker hub registry.

docker pull registry
Enter fullscreen mode Exit fullscreen mode

You should see the following or similar output:
Image description

Let's start the container with necessary settings:

docker run -d -p 5000:5000 --restart=always --name local_registry registry

Enter fullscreen mode Exit fullscreen mode

Let's check our docker containers:

docker ps
Enter fullscreen mode Exit fullscreen mode

You should see the following or similar output:
Image description

Let's download nginx image from docker registry and push it to our local registry.

docker pull nginx
Enter fullscreen mode Exit fullscreen mode

Now, let's tag nginx image as localhost:5005/local-nginx:

docker tag nginx localhost:5005/local-nginx
Enter fullscreen mode Exit fullscreen mode

Let's push our image to our local registry:

docker push localhost:5005/local-nginx
Enter fullscreen mode Exit fullscreen mode

You should see the following or similar output:

Image description

Let's turn our wifi off and try to download the image:

docker pull localhost:5005/local-nginx
Enter fullscreen mode Exit fullscreen mode

You should see the following or similar output:
Image description

We have successfully setup local docker registry.

Top comments (0)