You can configure a replication rule to replicate container images from a source instance to a destination instance across regions.
Usage notes
-
The source instance must be a Premium Edition or instance. The destination instance can be an Basic Edition or Premium Edition instance.
To upgrade an Enterprise Edition instance, go to the Container Registry console and click Upgrade in the lower-right corner of the instance card.
-
Replication from a public cloud region to a non-public cloud region, such as Finance Cloud or Gov Cloud, is not supported.
-
Some regions have special restrictions, such as no public network access for an OSS bucket. In these cases, you can only use custom replication links .
Automatic replication within the same account
A replication rule automatically replicates container images to a destination instance in the same account whenever a new image is pushed to the source instance.
Automatic replication applies only to new images pushed after the replication rule is created; it does not apply to existing images.
To replicate existing images, use one of the following approaches:
-
For a small number of existing images, you can replicate them manually. For more information, see Manual replication within the same account and CreateRepoSyncTask.
-
For a large number of existing images, we recommend using the OSS replication and ACR image import method:
-
Copy all files from the OSS bucket of the source instance to the OSS bucket of the destination instance. For more information, see Data replication.
-
Create an import rule with the migration source set to an OSS bucket. Then, start the image import task to migrate the images.
-
Automatic replication within the same account supports replication at the namespace and repository levels. The following requirements apply:
-
If you replicate images at the namespace level, the source and destination instances must have identical namespaces. The automatic repository creation feature must be enabled for these namespaces.
-
If you replicate images at the repository level, the source and destination instances must have an identical namespace and repository.
Log on to the Container Registry console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
-
In the left-side navigation pane, choose . Then, click Create Rule.
-
In the Create Rule dialog box's Instance configuration wizard, set the parameters, and then click Next.
Parameter
Description
Rule Name
Enter a name for the replication rule.
Replication Scenario
Select Same Account.
Destination Instance
Select the region and name of the destination instance.
NoteYou can automatically replicate images across regions without exposing public endpoints. This mitigates security risks associated with public network access.
-
In the Create Rule dialog box, set the parameters in the Replication Information configuration wizard, and then click Create Rule.
Parameter
Description
Replication Level
You can replicate images at the namespace or repository level.
Source Address
-
If you set Replication Level to Namespace, you must select a namespace and enter a regular expression to filter tags.
-
If you set Replication Level to Repository, you must select a namespace and a repository, and enter a regular expression to filter tags.
Pushing a new container image to a repository that matches the rule automatically triggers a replication task.
To view replication tasks, choose in the left-side navigation pane.
-
Manual replication within the same account
You can manually replicate a specific container image from a source instance to a destination instance in the same account.
Log on to the Container Registry console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
In the left-side navigation pane of the management page of the Enterprise Edition instance, choose .
-
On the Repositories page, click the name of the target repository.
-
In the left-side navigation pane, click Image Version. Find the target tag and click Replication in the Actions column.
-
In the Sync dialog box, set Replication Scenario to Same Account. Then, select the destination instance's region and name, choose the destination namespace, and enter the repository name and tag. Finally, specify whether to overwrite an existing image with the same name and click Confirm.
To verify the replication, choose . If the task status on the Replication Record page is Completed and you can find the replicated image in the destination instance, the manual replication is successful.
Related topics
To replicate images across accounts, see Replicate images across accounts.