All Products
Search
Document Center

Container Registry:Subscribe to image tags

Last Updated:Apr 23, 2024

If you want to replicate images from a source image repository, such as Docker Hub, Google Container Registry (GCR), or Quay, that resides outside the Chinese mainland to a destination repository in a Container Registry Enterprise Edition instance on a regular basis, you can use the artifact subscription feature of Container Registry Enterprise Edition instances. This topic describes how to subscribe to image tags from a source repository that resides outside the Chinese mainland.

Prerequisites

A Container Registry Enterprise Edition instance is created. For more information, see Create a Container Registry Enterprise Edition instance.

Automatic subscription

After you configure an artifact subscription rule, the image tags that reside in the source image repository and meet the subscription rule are replicated to the destination repository.

  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 card of the Container Registry Enterprise Edition instance for whose image repository you want to subscribe to image tags.

  5. In the left-side navigation pane of the management page of the Container Registry Enterprise Edition instance, choose Repository > Artifact Subscription.

  6. On the Artifact Subscription page, click Create Subscription Rule.

  7. In the Create Subscription Rule dialog box, configure the parameters in the Artifact Source step and then click Next. The following table describes the parameters.

    Parameter

    Description

    Artifact Source

    Select a source image repository that resides outside the Chinese mainland.

    Source Repository Location

    Enter the location of the source image repository. The location must be in the <Namespace>/<Repository> format. Example: library/nginx.

    Subscription Policy

    Subscribe to the image tag {tag} in the source repository: This parameter is required. Specify a regular expression that the image tags to be subscribed to must match. The default value .* indicates that you subscribe to all image tags in the source repository.

    Subscribe to the first {count} images in the source repository: This parameter is required. Configure the first {count} image tags among the image tags that reside in the Chinese mainland and meet the preceding regular expression. The first {count} image tags are replicated to the destination repository. You can configure up to five image tags of a Docker Hub source image repository or up to 30 image tags of an other-type source image repository.

    OS/Architecture

    If the source repository contains multi-architecture images, only the images that have the specified OSs or architectures are subscribed to the destination repository.

  8. In the Repositories step, configure parameters for the destination image repository and then click Create Subscription Rule. The following table describes the parameters.

    Parameter

    Description

    Repositories

    Specifies the destination repository in the Container Registry Enterprise Edition instance to which the subscription rule applies.

    Overwrite Image

    Specifies whether to overwrite existing images that have the same name in the destination repository.

    Acceleration Link

    The subscription acceleration feature is optimized based on scheduling policies and network links.

    Update Period

    The subscribed image tags in the source repository are replicated to the destination repository based on the update period.

Manual subscription

  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 card of the Container Registry Enterprise Edition instance for whose image repository you want to subscribe to image tags.

  5. In the left-side navigation pane of the management page of the Container Registry Enterprise Edition instance, choose Repository > Artifact Subscription.

  6. On the Artifact Subscription page, find the subscription rule that you want to apply and click Execute in the Actions column.

  7. In the Tips message, click OK.

    After the subscription task is executed, you can view the image tags that are subscribed to on the Tags page of the destination repository in the Container Registry Enterprise Edition instance.