Setting Up Gitlab container Registry on own Domain.

Reading Time : ~ .

GitLab Container Registry is a secure and private registry for Docker images integrated completely in Gitlab. In this tutorial we will setup and use GitLab Container Registry. If you're using previous versions of Gitlab upgrade and then follow this tutorial.

SSL Certificate - Eventhough docker may support unsecured private registries(self signed SSL Certifcates and http registy URL's). GitLab seems to accept only "https" in url of registry. as when i tried to use http in URL it throw me the following error

  RuntimeError
  ------------
  Unsupported GitLab Registry external URL scheme: http

you can use self signed certificates or use letsencypt's certbot(which is opensource certyfing tool).

Using Certbot

To use certbot stop any webservers you may be runnng(like nginx, apache). Ensure DNS Mapping is pointing to correct server and run following commands

git clone https://github.com/certbot/certbot
cd certbot
./certbot-auto certonly --standalone -d <domain-name>

you will be asked to enter an email for identity and recovery and your cert and key will be available in 

certificate -  /etc/letsencrypt/live/<domain-name>/fullchain.pem;
certificate_key - /etc/letsencrypt/live/<domain-name>/privkey.pem;

Modifying /etc/gitlab/gitlab.rb file: 

registry_external_url 'https://<domain/sub-domain name>'
registry_nginx['ssl_certificate'] = <location-to-certificate>
registry_nginx['ssl_certificate_key'] = <location-to-certificate-key>

Reconfigure GitLab

sudo gitlab-ctl reconfigure

Then under every Project Menu will have a Tab "Container Registry" which points to Projects Docker Image Container.

    By Posted On
SENIOR DEVELOPER at MICROPYRAMID

Need any Help in your Project?Let's Talk

Latest Comments
Related Articles
Clustering of Docker Containers using Docker Swarm Jagadeesh V

There are many available ways of Docker clustering. Kubernetes, Docker cloud, Docker Swarm etc., In this Tutorial we will learn setting up a cluster using ...

Continue Reading...
How to deploy django with uwsgi and nginx using Ansible play book. Dinesh Deshmukh

Ansible is a scripting language mostly used to automate installing applications, deploying apps etc..
Why Ansible:
You may think why learn new language if I ...

Continue Reading...
ELK Stack for Parsing your Logs Jagadeesh V

In This Tutorial we will look onto parsing your syslog files and store and display it in interactable website. We will be using ELK Stack ...

Continue Reading...

Subscribe To our news letter

Subscribe to our news letter to receive latest blog posts into your inbox. Please fill your email address in the below form.
*We don't provide your email contact details to any third parties