Sync images by using artifact subscription

更新时间:
复制 MD 格式

Pulling container images from external registries, such as Docker Hub, Google Container Registry (GCR), and Quay, may fail due to network issues. The artifact subscription feature allows your ACR Enterprise instance to directly sync images from external or custom sources to your image repositories without requiring additional network configurations.

Usage notes

This feature is available only for the Basic, Standard, and Premium editions of an ACR Enterprise instance. The quota for subscription rules varies by instance edition. For more information, see artifact subscription.

Set up an automatic subscription

After you set up an automatic subscription, your ACR Enterprise instance automatically syncs container images to a destination image repository according to the subscription rule.

  1. Log on to the Container Registry console.

  2. In the top menu bar, select a region. In the navigation pane on the left, click Instances.

  3. On the Instances page, click the target ACR Enterprise instance. In the navigation pane on the left, choose Repository > Artifact Subscription.

  4. On the Artifact Subscription page, click Create Subscription Rule. In the dialog box, configure the following parameters, and then click Next.

    Parameter

    Description

    Artifact Source

    Select the external source from which to subscribe to images.

    Source Repository Domain Name

    This option appears only when you select Custom Source for Artifact Source, and it is a required field.

    The domain name of the custom source. For example, for an image from the Anolis community, enter anolis-registry.cn-zhangjiakou.cr.aliyuncs.com.

    Source Repository Location

    The path to the source image repository. The path must be in the <namespace>/<repository> format. For example, library/nginx.

    Subscription Policy

    Image versions to subscribe to (Required): A regular expression that specifies which image versions to subscribe to. The default value, .*, matches all image versions.

    Subscribe to the first N images in the source repository (Required): The number of the latest matching image versions to sync. You can sync a maximum of 5 versions from Docker Hub and a maximum of 30 versions from other sources.

    OS/Architecture

    If the source repository contains multi-architecture images, you can specify an OS and architecture to subscribe only to images for that platform.

  5. On the Repositories page, configure the following settings and then click Create Subscription Rule.

    Parameter

    Description

    Repositories

    The destination image repository where synced images will be stored.

    Overwrite Image

    Specifies whether to overwrite an existing image in the destination repository if a synced image has the same name.

    Acceleration Link

    Enables faster image syncing through scheduling policies and network link optimization.

    Update Period

    Specifies the method for syncing updates from the source repository.

  6. After the rule is created, the ACR Enterprise instance automatically syncs images according to the rule. If you need an image before the next scheduled sync, you can run an immediate sync.

Run an immediate sync

You can manually trigger a subscription rule to sync images at any time.

  1. Log on to the Container Registry console.

  2. In the top menu bar, select a region. In the navigation pane on the left, click Instances.

  3. On the Instances page, click the target ACR Enterprise instance. In the navigation pane on the left, choose Repository > Artifact Subscription.

  4. On the Artifact Subscription page, find the desired subscription rule and click Execute in the Actions column.

  5. In the Tips dialog box, click Confirm.

    After the sync task is complete, you can view the synced container images in the destination image repository.