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:
|
|
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
:
|
|
OR
|
|
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:
|
|
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.