How to Set Up Docker Registry with Harbor
Harbor is an open-source container registry that provides image management, vulnerability scanning, and access control. Run your own private registry on a Breeze server to keep container images close to your infrastructure.
Prerequisites
- A Breeze instance with at least 4 GB RAM and 40 GB disk
- Docker and Docker Compose installed
- A domain name with SSL certificate
Downloading and Installing Harbor
cd /opt
curl -sL https://github.com/goharbor/harbor/releases/download/v2.11.0/harbor-online-installer-v2.11.0.tgz | tar xz
cd harbor
cp harbor.yml.tmpl harbor.yml
Configuring Harbor
Edit harbor.yml with your settings:
hostname: registry.yourdomain.com
https:
port: 443
certificate: /etc/letsencrypt/live/registry.yourdomain.com/fullchain.pem
private_key: /etc/letsencrypt/live/registry.yourdomain.com/privkey.pem
harbor_admin_password: YourSecurePassword123
database:
password: DbPassword456
Running the Installer
sudo ./install.sh --with-trivy
The --with-trivy flag enables built-in vulnerability scanning.
Pushing Images to Harbor
docker login registry.yourdomain.com
docker tag myapp:latest registry.yourdomain.com/myproject/myapp:latest
docker push registry.yourdomain.com/myproject/myapp:latest
Key Features
- Role-based access control for teams
- Automatic vulnerability scanning with Trivy
- Image replication across multiple registries
- Garbage collection to reclaim storage