Hosting Private Docker Registry on Cloud

Photo by Guillaume Bolduc on Unsplash

Configuring Digital Ocean Droplet

ssh root@<DROPLET-IP>
apt-get update && apt-get upgrade -y
apt install docker.io 
apt install docker-compose
mkdir docker-registry 
cd docker-registry
touch docker-compose.yml
version: "3"  services:     
docker-registry:
image: registry:2
container_name: docker-registry
ports:
- 5000:5000
restart: always
volumes:
- ./volume:/var/lib/registry
mkdir volume
docker-compose up -d

Configuring Local Development Environment

vim /etc/docker/daemon.json
vim ~/.docker/daemon.json
{
"insecure-registries": ["<DROPLET-IP>:5000"]
}

Testing

docker pull alpine
docker tag alpine:latest <DROPLET-IP>:5000/fo/alpine-fo:v1
docker push <DROPLET-IP>:5000/fo/alpine-fo:v1
docker rmi alpine:latest <DROPLET-IP>:5000/fo/alpine-fo:v1
docker pull <DROPLET-IP>:5000/fo/alpine-fo:v1
docker run -it <DROPLET-IP>:5000/fo/alpine-fo:v1
Running Alpine terminal successfully

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store