Service: Harbor - EyevinnOSC/community GitHub Wiki
Harbor (serviceId goharbor-harbor) is an open source container registry that stores and distributes container images and OCI artifacts, with projects and role-based access control, a web portal and a REST API with Swagger, on top of the Docker Distribution registry. In Eyevinn Open Source Cloud (OSC) it is a long-running service instance with the portal, registry and job service built in. License: Apache-2.0. Storage is a 50 GiB persistent volume per instance, or optionally an S3-compatible bucket.
- Push, pull and store container images and OCI artifacts with standard Docker clients.
- Organize images in projects with role-based access control.
- Manage the registry through the web portal or the REST API.
- Store image data on the persistent volume (default) or in an S3-compatible bucket.
Harbor needs two dependencies that must exist and be running before you create the Harbor instance:
-
PostgreSQL (
birme-osc-postgresql, see Service: PostgreSQL): create an instance with a database name, for exampleharbor. The database must already exist; Harbor does not create it. Usedescribe-service-instanceto read the internal cluster hostname and build the URLpostgres://<user>:<password>@<internal-hostname>:5432/harbor?sslmode=disable. Only thesslmodequery parameter is used. Percent-encode special characters in the password. -
Valkey (
valkey-io-valkey, see Service: Valkey): create an instance with a password and build the URLredis://:<password>@<internal-hostname>:6379. - Store the values as service secrets with
create-service-secret(serviceIdgoharbor-harbor): for exampleharbordburl(the full PostgreSQL URL),harborredisurl(the full Redis URL) andharboradminpw(the admin password). A{{secrets.NAME}}reference only works as the entire field value, so each URL must be stored whole. - Create the instance with
create-service-instance,serviceId: "goharbor-harbor":
{
"name": "myharbor",
"DatabaseUrl": "{{secrets.harbordburl}}",
"RedisUrl": "{{secrets.harborredisurl}}",
"AdminPassword": "{{secrets.harboradminpw}}"
}Leave the other options empty to store images on the persistent volume. The instance shows as running after about 10 seconds, but Harbor runs database migrations on first start and only answers after about 30 to 40 seconds. Use wait-for-service-ready or get-instance-status, then describe-service-instance for the instance URL. Keep a copy of the admin password; it cannot be read back from the service.
| Option | Required | Type | Meaning |
|---|---|---|---|
| name | Yes | string | Name of the instance. Alphanumeric, at most 20 characters. |
| DatabaseUrl | Yes | string, sensitive | PostgreSQL URL postgres://user:password@host:5432/dbname?sslmode=disable. The database must already exist; if the name is omitted it defaults to registry. Only the sslmode query parameter is used. Feeds DATABASE_URL, which the image splits into Harbor's database settings. |
| RedisUrl | Yes | string, sensitive | Redis or Valkey URL redis://[user]:password@host:6379, or rediss:// for TLS. Harbor uses database indexes 0, 1 and 2, so any index in the URL is ignored. Do not share one Redis instance between two Harbor instances. Feeds REDIS_URL. |
| AdminPassword | Yes | string, sensitive | Password for the built-in admin user. Only applied when Harbor initialises a new database; changing it later has no effect. If left empty a random password is generated and cannot be read from the service. Feeds HARBOR_ADMIN_PASSWORD. |
| StorageBackend | No | string | Where image data is stored: filesystem (default, on the persistent /data volume) or s3 for an S3-compatible bucket. s3 also requires S3Bucket, S3AccessKey and S3SecretKey. Feeds STORAGE_BACKEND. |
| S3Endpoint | No | string | Endpoint of the S3-compatible storage service, passed to the registry's regionendpoint setting. Only used when StorageBackend is s3; leave empty for AWS S3. Feeds S3_ENDPOINT. |
| S3Bucket | No | string | Name of an existing bucket for image data. Required when StorageBackend is s3. Feeds S3_BUCKET. |
| S3AccessKey | No | string, sensitive | Access key for the S3 bucket. Required when StorageBackend is s3. Feeds S3_ACCESS_KEY. |
| S3SecretKey | No | string, sensitive | Secret key for the S3 bucket. Required when StorageBackend is s3. Feeds S3_SECRET_KEY. |
Store the sensitive options as secrets and pass them as {{secrets.NAME}}, as the entire field value.
Open the instance URL and sign in as user admin with the admin password. Create a project (for example library) in the web UI before pushing images.
Harbor does its own authentication, so all paths on the instance URL are reachable and standard Docker clients work. No HTTPS configuration is needed; OSC terminates TLS in front of the instance. Push and pull an image, replacing the placeholders with your instance host name (without https://) and project name:
docker login <instance-host> -u admin
docker pull alpine:3.20
docker tag alpine:3.20 <instance-host>/<project>/alpine:t1
docker push <instance-host>/<project>/alpine:t1
docker pull <instance-host>/<project>/alpine:t1- Single instance, no high availability.
- Trivy vulnerability scanning, SBOM scanning and the metrics exporter are not included in this service.
- The initial admin password cannot be read back from the service.
- Webhooks to private or internal addresses are rejected by default.