Container Registry (ACR) lets you replicate container images from a source instance to a destination instance across regions within the same Alibaba Cloud account. Use this to distribute images for multi-region deployments, disaster recovery, or staging-to-production workflows.
Two replication modes are available:
| Mode | Best for | Trigger |
|---|---|---|
| Automatic | Continuous sync of new images | New image pushed to a matching repository |
| Manual | One-off replication of a specific image | Initiated by you in the console |
Prerequisites
Before you begin, ensure that you have:
-
A Premium Edition instance as the source. The destination instance can be Basic Edition or Premium Edition. To upgrade an instance, open the Container Registry console and click Upgrade in the lower-right corner of the instance card.
-
Verified that both source and destination regions are public cloud regions. Replication from a public cloud region to a Finance Cloud or Gov Cloud region is not supported.
-
Checked whether your regions require custom replication links. Some regions restrict public network access for OSS buckets, and standard replication links do not work in those regions.
Set up automatic replication
Automatic replication pushes new images to a destination instance as soon as they are uploaded. A replication rule defines which namespaces or repositories to replicate and how to filter image tags.
Automatic replication applies only to images pushed after the rule is created. It does not apply to images that already exist in the source instance.
To replicate existing images, choose the approach that fits your volume:
| Volume | Approach |
|---|---|
| Small number of images | Replicate manually. See Set up manual replication or use the CreateRepoSyncTask API. |
| Large number of images | Use OSS replication + ACR image import: (1) Copy all files from the source OSS bucket to the destination instance's OSS bucket — see Data replication. (2) Create an import rule, select the OSS bucket as the migration source, and start the image import task. |
Replication level requirements:
| Replication level | Requirement |
|---|---|
| Namespace | Source and destination instances must have identical namespaces. The "auto-create repository" feature must be enabled for those namespaces. |
| Repository | Source and destination instances must have an identical namespace and repository. |
Create a replication rule
-
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 navigation pane, choose Distribution > Instance Replication and click Create Rule.
-
In the Instance Information step, configure the following parameters and 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. Replicating across regions without enabling public network access helps prevent security risks. -
In the Replication Information step, configure the following parameters and click Create Rule.
Parameter Description Replication Level Select Namespace or Repository. Source Address (Namespace) Select the source namespace and enter a regular expression to filter image tags. Source Address (Repository) Select the source namespace and repository, and enter a regular expression to filter image tags.
When a new image is pushed to a repository that matches the rule, the system automatically triggers a replication task. To view replication tasks, choose Distribution > Replication Record in the navigation pane.
Set up manual replication
Replicate a specific image from a source instance to a destination instance on demand.
-
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 Repository > Repositories.
-
On the Repositories page, click the name of the target repository.
-
In the left navigation pane, click Tags, find the target image, and click Replicate in the Actions column.
-
In the Image Replication dialog box, configure the following and click OK:
Setting Description Replication Scenario Select Same Account. Destination instance Select the region and name of the destination instance. Namespace Select the destination namespace. Repository name and tag Enter the destination repository name and image tag. Overwrite existing images Specify whether to overwrite images with the same name in the destination.
Verify replication
On the management page of the Enterprise Edition instance, choose Distribution > Replication Record. Replication is successful when the task status shows Completed and the image appears in the destination instance.
Related topics
To replicate images between instances that belong to different Alibaba Cloud accounts, see Replicate images across accounts.