Hi All, this document deals with how to install private Docker registry in ubuntu 16.04.
Docker registry is the place where you can create a repository and store all the images for your docker container.
If you consider the security issue, then it is always better to keep your container images in a private registry.

Learn more about docker registry and repository from here.

Prerequisites:

Docker installed in your System, if not check this link to perform this.

configuration

Step 1: Create DNS record for your Docker registry instance, here had created local DNS as dockerreg
Step 2: Pull the docker registry image from docker hub.

docker pull registry

Step 3: Run the docker registry image.

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

Step 4: Now you have done with the setup docker registry. Now, let’s look in how to how to push and pull the docker images to the newly created private registry.
Step 5: Here I have my own docker image called “prabhin/new: latest”. Now, let’s push this image to provide registry.
Step 6: First change the image tag to the private registry.

docker tag prabhin/new:latest dockerreg:5000/prabhin:latest

Now my existing prabhin/new: latest image tag is changed to dockerreg:5000/prabhin: latest
Step 7: Now push the docker image to our private registry.

docker push dockerreg:5000/prabhin: latest

Step 8: Now the image has pushed to the private registry.
Step 9: Open browser and http://dockerreg:5000/v2/catalog
This is your docker registry and you can see your repository has created.
Step 10: Now you can pull these image in any other host.

docker pull dockerreg:5000/prabhin:latest

if the terminal throws any HTTP to https client error, create the following with following contents

vi /etc/docker/daemon.json
{ "insecure-registries":["dockerreg:5000"] }

Now you will be able to pull docker images from the private registry.

Happy Learning 🙂

© 2019, Techrunnr. All rights reserved.

#1
#2
#3
Questions Answered
Articles Written
Overall Points
Categories: devopsdocker

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

Leave a Reply

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.