Container Registry allows you to create a public image repository. Other users can search for and use images from this repository in the Container Registry console. This topic describes how to create a public image repository and upload an image as a user, and then use the image as another user. User A and user B are used as examples. User A creates a public image repository and uploads an image. Then, user B obtains the image address under the image repository from Image Hub and uses the image.

Prerequisites

An instance of Container Registry Personal Edition is created. For more information, see Create a Container Registry Personal Edition instance.

Step 1: Create a public image repository

  1. Log on to the Container Registry console as user A.
  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 default instance.
  5. On the Repositories page, click Create Repositories.
  6. In the Repository Info step, configure Namespace, Repository Name, and Summary. Then, set Repository Type to Public, and click Next.
  7. In the Code Source step, configure Code Source and click Create Repositories.
    Parameter Description
    Code Source Select a code source. Valid values: Code, GitHub, Bitbucket, Private GitLab, and Local Repository.
    Note If you select Code, GitHub, Bitbucket, or Private GitLab as the code source, you must bind your Container Registry instance to a code source repository. For more information, see Step 1: Bind a source code repository.
    Build Settings If you select Code, GitHub, Bitbucket, or Private GitLab as the code source, you must configure Build Settings.
    • Automatically Build Images When Code Changes: If you select this option, an image is automatically built when code is committed from a branch.
    • Build With Servers Deployed Outside Mainland China: If you select this option, an image is built in a data center outside mainland China, and then pushed to the specified image repository.
    • Build Without Cache: If you select this option, the system pulls the base image from the source code repository each time an image is built. This may increase the time required to build the image. You can disable Build Without Cache to accelerate the build process.

Step 2: Configure an image

You can push images to the public image repository that you created. For more information, see Use a Container Registry Personal Edition instance to push and pull images. You can also build images in a public image repository. For more information, see Create a repository and build images.

Step 3: Obtain the address of a public image from Image Hub

  1. Log on to the Container Registry console as user B.
  2. In the top navigation bar, select a region.
  3. In the left-side navigation pane, choose Image Hub > Search.
  4. On the Image Search page, select User Public Image, search for a public image in the search box, and then click the image name.
    On the Image Details page, view the address of the public image. You can use the image to create an application.

    You can also click Add to Favorites in the upper-right corner of the image details page. In the left-side navigation pane, choose Image Hub > Favorites. On the Favorites page, you can view the favorite image and the version iterations of the image.