Steps to configure private registry for Docker Windows server 2016

Steps to configure private registry for Docker Windows server 2016

Steps to configure private registry for Docker Windows server 2016

In this blog, we will show you the Steps to Configure private registry for docker Windows server 2016.

 

REQUIREMENTS

  • Windows VM with docker service
  • Linux VM (ubuntu or centos) with docker service

 

OVERVIEW

  • Docker registry is a core open-source project and it’s available for free in docker hub.
  • Docker registry will be installed locally so it will be secure and really very fast.
  • Currently, docker has not provided any registry container to run on windows platform.
  • So we need to use the Linux environment to configure the private registry to store our windows container images.

 

INSTALLING DOCKER ON WINDOWS

  • We have already installed docker service on windows server 2016.

Steps to configure private registry for Docker Windows server 2016

 

  • Please check the URL to install the docker on windows 2016.

https://www.assistanz.com/installing-docker-in-windows-2016/

 

PREPARING THE UBUNTU ENVIRONMENT

 

Note: We are using the ubuntu flavour OS for this demo

 

  • Login into ubuntu vm through putty.

Steps to configure private registry for Docker Windows server 2016

 

  • We have already enabled the root user to access the VM.

Steps to configure private registry for Docker Windows server 2016

 

  • Open the hostname file to add a hostname for this VM.

Steps to configure private registry for Docker Windows server 2016

 

  • Add a hostname for this VM along with IP. Save the changes and close the file.

Steps to configure private registry for Docker Windows server 2016

 

  • Update the available packages in the Ubuntu VM using apt-get update command.

Steps to configure private registry for Docker Windows server 2016

 

INSTALLING THE DOCKER ON UBUNTU

  • Use the below command to install the docker on ubuntu

apt-get install –y docker.io

Steps to configure private registry for Docker Windows server 2016

 

  • It will take few minutes to complete the operation.

Steps to configure private registry for Docker Windows server 2016

 

  • Check the docker service status using the below command.

service docker status

Steps to configure private registry for Docker Windows server 2016

 

  • To verify the docker version, type docker version command.

Steps to configure private registry for Docker Windows server 2016

 

CREATING DOCKER REGISTRY

  • You can find the docker official registry from the below URL.

https://hub.docker.com/_/registry/

Steps to configure private registry for Docker Windows server 2016

 

  • Use the docker pull command to pull the registry image from the docker hub.

docker pull registry

Steps to configure private registry for Docker Windows server 2016

 

  • You can verify the list of docker images using the below command.

docker images

Steps to configure private registry for Docker Windows server 2016

 

  • By default, docker registry will listen in port 5000. Launch the registry container using the docker run in detach mode along with port 5000 mapping.

docker run –name regdock -p 5000:5000 -d registry

Steps to configure private registry for Docker Windows server 2016

 

  • To verify the running container, execute the docker ps command.

Steps to configure private registry for Docker Windows server 2016

 

  • Now the container is listening in the port 5000. We can use the system name or IP to access this container from other machines.

 

VERIFY THE DOCKER REGISTRY CONTAINER

  • To get into the registry container, run the below command.

docker exec -it regdock sh

Steps to configure private registry for Docker Windows server 2016

 

  • The default location of registry config file inside the container is /etc/docker/registry/config.yml

Steps to configure private registry for Docker Windows server 2016

 

  • Open the config.yml file in VI editor. By default, it listens to port 5000 and our private images will be stored under /var/lib/registry directory.

Steps to configure private registry for Docker Windows server 2016

 

  • By default, registry container listens through https. To disable the HTTPS, Go-to /etc/docker/ directory on your Ubuntu machine.

Steps to configure private registry for Docker Windows server 2016

 

  • Create a new file name named daemon.json file and add the below entry.

{“insecure-registries”:[“privaterepo:5000”]}

Steps to configure private registry for Docker Windows server 2016

Steps to configure private registry for Docker Windows server 2016

 

Note: Here privaterepo is the machine host name. Modify it based on your machine name.

 

  • Save and close the file.

Steps to configure private registry for Docker Windows server 2016

 

PREPARE THE WINDOWS DOCKER MACHINE

  • Login into windows VM and Go-to C:\programdata\docker\config folder.

Steps to configure private registry for Docker Windows server 2016

 

  • Create a new filename daemon.json in that folder.

Steps to configure private registry for Docker Windows server 2016

 

  • Open the daemon.json file and add the below entry.

{“insecure-registries”:[“privaterepo:5000”]}

Steps to configure private registry for Docker Windows server 2016

 

  • Save and close the file.

 

  • Go-to C:\Windows\System32\drivers\etc folder.

Steps to configure private registry for Docker Windows server 2016

 

  • Open the hosts file in the notepad.

Steps to configure private registry for Docker Windows server 2016

 

  • Add your ubuntu machine name and its IP address.

Steps to configure private registry for Docker Windows server 2016

 

  • Save and close the hosts file. Verify the hostname through PING command.

Steps to configure private registry for Docker Windows server 2016

 

PREPARING THE IMAGES

  • From the windows machine,  type docker images to list the available images in the windows docker.

Steps to configure private registry for Docker Windows server 2016

 

  • The image name should be in the below format

private repo namespace:<portnumber>/imagename

Example: privaterepo:5000/mynanoserver

 

  • Rename the image name as shown as above. We are using nanoserver for this demo.

docker tag microsoft/nanoserver privaterepo:5000/mynanoserver

Steps to configure private registry for Docker Windows server 2016

 

  • Untag the old image name using the below command.

docker rmi microsoft/nanoserver:latest

Steps to configure private registry for Docker Windows server 2016

 

VERIFICATION

  • Use the below command to push docker images to docker registry.

docker push privaterepo:5000/mynanoserver

Steps to configure private registry for Docker Windows server 2016

 

  • We can use the below URL to view the list of images available in the private registry through a web browser.

http://privaterepo:5000/v2/_catalog

Steps to configure private registry for Docker Windows server 2016

 

Note: Privaterepo is the ubuntu machine name.

 

  • Login into registry container and go-to /var/lib/registry/docker/registry/v2/repositories directory and you will able to view the pushed images.

Steps to configure private registry for Docker Windows server 2016

 

VIDEO

Thanks for reading this blog. We hope it was useful for you to learn about configuring the private repository for docker windows 2016.

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn
More Interested Related Posts
zfs pool usage

ZFS Pool and Dataset Usage

ZFS Pool and Dataset Usage I am back with another blog to provide the useful script to the Freebsd users to determine the zpool and

Assistanz Networks

Installing Zabbix Agent in FreeBSD 12.0

Zabbix Agent Installation and Configuration Guide on FreeBSD 12.0   Zabbix is an open-source monitoring software tool for diverse IT components, including networks, servers, virtual

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support