You can configure synchronization rules to synchronize images from a source Container Registry instance to a destination Container Registry instance. You can synchronize images between Container Registry instances that reside in different regions. This topic describes how to set up manual and automatic image synchronization between Container Registry instances that belong to the same account.

Prerequisites

Make sure that the source instance is a standard or advanced Container Registry instance of Enterprise Edition. You cannot synchronize images from a basic Container Registry instance of Enterprise Edition. The destination instance can be a basic, standard, or advanced Container Registry instance of Enterprise Edition.
Note To upgrade a Container Registry Enterprise Edition instance, find the instance on the Instances page and click Upgrade in the lower-right corner.

Automatic synchronization between instances that belong to the same account

You can configure a synchronization rule to automate image synchronization between two instances that belong to the same account. After you upload an image to the source instance, the system automatically synchronizes the image to the destination instance.

Images can be automatically synchronized between instances that belong to the same account by namespace or repository.
  • To synchronize images by namespace, the source instance and destination instance must have the same namespace and repositories can be automatically created in the namespace.
  • To synchronize images by repository, the source and destination instance must have the same repository in the same namespace.
  1. Log on to the Container Registry console.
  2. In the top navigation bar, select a region.
  3. In the left-side navigation pane, click Instances.
  4. On the Instances page, click the required Container Registry Enterprise Edition instance.
  5. On the management page of your Container Registry Enterprise Edition instance, choose Distribution > Instance Replication in the left-side navigation pane. Then, click Create Rule on the right side of the page.
  6. In the Create Rule dialog box, set the parameters on the Instance Information wizard page and click Next.
    Note

    If you specify an instance as the source instance in one synchronization rule, you cannot specify the instance as the destination instance in other synchronization rules. If you specify an instance as the destination instance in one synchronization rule, you cannot specify the instance as the source or destination instance in other synchronization rules. For example, you can specify Instance A as the source instance in one synchronization rule. However, when you create another synchronization rule, you cannot specify Instance A as the destination instance. You can specify Instance A only as the source instance.

    Parameter Description
    Rule Name Enter a name for the synchronization rule.
    Synchronization Scenario Click the Same Account tab.
    Target Instance Select the region where the destination instance is deployed and the destination instance.
    Note Images can still be automatically synchronized across regions even if Internet access is blocked to reduce potential security risks.
  7. In the Create Rule dialog box, set the parameters on the Replication Information wizard page and click Create Rule.
    Parameter Description
    Replication Level Images can be synchronized by namespace or repository.
    Source Address
    • If you set Replication Level to Namespace, select the namespace and enter a regular expression to filter repository versions.
    • If you set Replication Level to Repository, select the namespace and the repository, and enter a regular expression to filter repository versions.

    A synchronization task is automatically triggered when a new image is uploaded to the repository whose name matches the specified synchronization rule.

    On the management page of the instance, choose Distribution > Replication Record. On the page that appears, you can view synchronization tasks.

Manual synchronization between instances that belong to the same account

You can configure a synchronization rule to synchronize an image from a source instance to a destination instance that belongs to the same account as the source instance.

  1. Log on to the Container Registry console.
  2. In the top navigation bar, select a region.
  3. On the Instances page, click the required Container Registry Enterprise Edition instance.
  4. On the Repositories page, click the name of the repository that you want to manage.
  5. On the repository details page, click Tags in the left-side navigation pane. Find the image that you want to synchronize and click Sync in the Actions column.
  6. In the Sync dialog box, set Synchronization Scenario to Same Account, select the region where the destination instance is deployed and the destination instance, select the namespace, enter the destination repository name and image tag, specify whether to overwrite images with the same name, and then click OK.
    On the management page of your Container Registry Enterprise Edition instance, choose Distribution > Replication Record in the left-side navigation pane. On the Replication Record page, you can find that the status of the synchronization task is Completed. If the image exists in the destination instance, manual synchronization is successful.