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:
- Docker Hub
- Azure Container Registry
- Google Container Registry
- Google Artifact Registry
- Amazon EC2 Container Registry
But, How about when you are offline and cannot access these registries?
Let's setup our own local offline accessible docker registry.
First, we have to install Registry container from docker hub registry.
docker pull registry
Let's start the container with necessary settings:
docker run -d -p 5000:5000 --restart=always --name local_registry registry
Let's check our docker containers:
Let's download nginx image from docker registry and push it to our local registry.
docker pull nginx
Now, let's tag nginx image as localhost:5005/local-nginx:
docker tag nginx localhost:5005/local-nginx
Let's push our image to our local registry:
docker push localhost:5005/local-nginx
You should see the following or similar output:
Let's turn our wifi off and try to download the image:
docker pull localhost:5005/local-nginx
We have successfully setup local docker registry.