Featured image of post Running a Locally Hosted Docker Registry GUI with Harbor

Running a Locally Hosted Docker Registry GUI with Harbor

This guide explains how to set up a Docker Registry GUI using Harbor on a Ubuntu virtual machine. The registry will operate within a Docker container. The tutorial uses docker-compose to create the necessary containers.

Downloading and Unpacking the Harbor Installer

You’ll begin by downloading the Harbor installer, extracting its contents, and navigating to the Harbor directory:

1
2
3
4
5
wget https://github.com/goharbor/harbor/releases/download/v2.3.1/harbor-offline-installer-v2.3.1.tgz

tar -xzf harbor-offline-installer-v2.3.1.tgz

cd harbor/

Generating SSL Certificates for Internal Use

This section focuses on generating SSL certificates for internal registry use. For external access, obtain certificates from a trusted Certificate Authority. These steps are Linux-specific.

Open a terminal and execute the commands below, replacing the placeholder text with your organization’s details. In the cat command where [alt_names] appears, substitute DNS.1, DNS.2, and DNS.3 with your host machine’s local IP or FQDN. If your machine’s name is “hostname” and your network domain is “.local”, use “hostname.local” and “hostname” as your DNS entries. You can include the static IP as well. Remove any unnecessary DNS entries. If you encounter issues with the cat command, download a pre-created file V3.ext.

After creating the certificates, store them securely for adding as “trusted” on machines accessing the registry.

Preparing for Installation

A pre-made docker-compose.yml file is available for deploying the registry and Harbor GitHub. This file should be placed in the Harbor directory created earlier. Retrieve the file using either curl or wget:

1
curl -LJO [https://raw.githubusercontent.com/Nexus-Security/Harbor-Registry/main/docker-compose.yml](http://curl -LJO https://raw.githubusercontent.com/Nexus-Security/Harbor-Registry/main/docker-compose.yml "https://raw.githubusercontent.com/Nexus-Security/nginx-proxy-manager/main/docker-compose.yml")

OR

1
wget --no-check-certificate --content-disposition [https://raw.githubusercontent.com/Nexus-Security/Harbor-Registry/main/docker-compose.yml](https://raw.githubusercontent.com/Nexus-Security/Harbor-Registry/main/docker-compose.yml)

Alternatively, you can create your own docker-compose.yml file by taking the content from the provided GitHub link.

Installing the Registry and Harbor

With everything in place, run the following command to start the installation process:

1
docker-compose up -d

This might take several minutes to complete. Upon successful completion, the containers for your Docker Registry and Harbor (the GUI) will be operational. You can then access the Harbor GUI via a web browser using https://hostname, https://hostname.local, or https://IP_OF_HOST assuming the SSL certificates are trusted.

Managing Harbor

Harbor’s official documentation at https://goharbor.io/docs/2.3.0/administration/ offers comprehensive information about Harbor administration.

Conclusion

After completing these steps, you should have a functional Docker Registry and Harbor setup. Remember to explore Docker image and container tagging for effective registry management.

Licensed under CC BY-NC-SA 4.0