Cloud Native 5 min read

How to Seamlessly Sync Images Between Harbor and Docker Registry

This guide walks you through configuring Harbor and Docker Registry replication, covering background considerations, creating replication repositories and rules, manual sync triggers, and reference resources, so you can keep container images up‑to‑date and secure.

Linux Ops Smart Journey
Linux Ops Smart Journey
Linux Ops Smart Journey
How to Seamlessly Sync Images Between Harbor and Docker Registry

With the rise of container technologies, many enterprises use Docker and Kubernetes for deployment. Harbor, an open‑source registry, provides a secure and efficient solution for managing container images. This article explains how to synchronize images between Harbor and a Docker Registry, ensuring your images stay current.

Background

Production environments often isolate networks for security, making them inaccessible from the public internet. When deploying a Kubernetes cluster, a temporary Registry is used to store images; after Harbor is installed, images from that Registry are synchronized to Harbor.

Creating Replication Rules

1. Create a replication repository

Tip:

Provider: Docker Registry

Destination name: Custom

Destination URL: Docker Registry address (must include "http://")

Verify remote certificate: Unchecked

2. Create a replication rule

Tip:

Replication mode: push (Harbor pushes to Registry) or pull (Harbor pulls from Registry)

Source resource filter: ** or empty matches all; v1* matches resources ending with v1

Destination namespace: empty = same as source; otherwise specify namespace

Repository flattening: No replacement, replace all levels, replace level 1, level 2, level 3

Trigger mode: Scheduled or manual

Cron format: second minute hour day month weekday

Example: with namespace "ns" and source image "a/b/c/d/img", "no replacement" results in "ns/a/b/c/d/img"; "replace all levels" results in "ns/img"; "replace level 1" results in "ns/b/c/d/img".

Manual Trigger Synchronization

1. Manually trigger sync

2. View synchronization status

Tip: Click the sync ID to see detailed progress.

Reference Articles

https://goharbor.io/docs/2.11.0/administration/configuring-replication/

https://goharbor.io/docs/2.11.0/administration/configuring-replication/manage-replications/

Conclusion

After studying this guide, you should be able to proficiently sync images between Harbor and Docker Registry, whether manually or automatically, ensuring your container images remain up‑to‑date, improving deployment efficiency, and enhancing security and manageability.

KubernetesContainer SecurityDocker RegistryHarborImage Replication
Linux Ops Smart Journey
Written by

Linux Ops Smart Journey

The operations journey never stops—pursuing excellence endlessly.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.