If you plan to run a registry in your platform, it could be a good idea to replicate container images from public registries (e.g. Docker Hub or quay.io) to your registry avoiding possible downtimes caused by these third parties.
quay.io and Docker Hub are public container registries which could be affected by outages out of your control, as all third-party dependencies. This guide helps to increase your business resilience to outages from public services.
- Connectivity to the registry (including credentials)
Make sure you know the Harbor external hostname, username, and password.
Let's assume these values in this example:
Log in the Harbor web console:
To start replicating container images from public repositories you have to declare what is your upstream container registry.
Navigate to Administration -> Registries
Then, click the + NEW ENDPOINT button to declare the upstream container image registry. As an example, lets replicate images from quay.io
Configure the registry details as shown in the previous image and click OK.
Feel free to test connectivity before clicking OK. Harbor should be able to reach the upstream registry.
Navigate to Administration -> Replications
This replication rule specifies:
- Name: Simple name of the rule. Example:
- Description: Description of the rule. It can be empty. Example:
Replicate prometheus node-exporter 0.18 from quay
- Replication mode: Pull or Push. Pull downloads images from the source registry,
Push from Harbor to an upstream registry. Example:
- Source Registry: Upstream registry. Must be declared before. Example:
- Source resource filter: Filter the name and tags. Example:
- Destination namespace: Destination project + registry where to place the container images. Example:
- Trigger mode: Describes how to trigger this rule. Manual or Scheduled. Example
In some use cases is a good idea to run this rule using a schedule.
Now you can see the rule. Select it and press REPLICATE button to start replicating from quay.io.
Wait until the execution success rate raises 100%. It could take up to two minutes to run this example.
Now Navigate back to Projects -> library -> Repositories:
It should be present a new repository inside the
library project named
node_exporter. It will contain images
copied from quay.io.
Then you will be able to pull the
node_exporter container image from your Harbor instance:
$ docker pull harbor.example.com/library/node-exporter:v0.18.1 v0.18.1: Pulling from library/node-exporter 49a2d53aa1af: Pull complete 3589a6efd9ce: Pull complete 190160031744: Pull complete Digest: sha256:a2f29256e53cc3e0b64d7a472512600b2e9410347d53cdc85b49f659c17e02ee Status: Downloaded newer image for harbor.example.com/library/node-exporter:v0.18.1 harbor.example.com/library/node-exporter:v0.18.1
Was this page helpful?
Glad to hear it! Thanks for letting us know!
Sorry to hear that. Please tell us how we can improve.