All Products
Search
Document Center

Container Registry:Push images to and pull images from an image repository of a Container Registry Personal Edition instance

Last Updated:Mar 11, 2025

Docker is a containerized application platform that lacks image hosting capabilities. By pushing Docker images to image repositories of Container Registry Personal Edition instances, you can utilize basic Container Registry features and image hosting capabilities. Other users can also pull your Docker images from these repositories.

Prerequisites

Step 1: obtain the username that you use to log on to the Container Registry Personal Edition instance

You can log on to Container Registry console, and select Repository Management > Access Credential on the Personal Edition instance management page to obtain the username.

  • If you are using an Alibaba Cloud account, the account name is your username for logging on to the Container Registry Personal Edition instance.

  • If you are using a RAM user, the username is the RAM user account name without the suffix onaliyun.com. For example, if your RAM user account is XXX@10051309672****.onaliyun.com, the username is XXX@10051309672****.

Step 2: Set a password that you use to log on to the Container Registry Personal Edition instance

First-time password setup

If it's your first time logging on to the Container Registry console, you must set a logon password for your Container Registry Personal Edition instance to facilitate image uploads and downloads.

  1. Log on to the Container Registry console.

  2. Click the Set A Registry Logon Password option.

  3. In the Set A Registry Logon Password dialog box, enter the Password and Confirm Password , then click OK.

Reset password

If you forget the password you set, you can reset it using an access credential.

  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 Personal Edition instance that you want to manage.

  5. On the Personal Edition instance management page, select Repository Management > Access Credential

  6. On the Access Credential page, you can click Set A Fixed Password and follow the instructions to reset the password.

    Note

    Container Registry Personal Edition does not support the retrieval of temporary accounts and passwords for instance logon via GetAuthorizationToken. It is recommended to use a permanent password for logging on.

Step 3: Create a namespace

Namespaces allow you to manage a collection of repositories, such as managing permissions on repositories and modifying repository attributes.

  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 Personal Edition instance that you want to manage.

  5. On the Personal Edition instance management page, select Repository Management > Namespace.

  6. On the Namespace page, click Create Namespace.

  7. In the Create Namespace dialog box, enter the namespace name and click OK .

Step 4: create an image repository

  1. Log on to the Container Registry console.

  2. In the left-side navigation pane, click Instances.

  3. On the Instances page, click the Personal Edition instance that you want to manage.

  4. On the Personal Edition instance management page, select Repository Management > Image Repository.

  5. On the Image Repository page, you can click Create Image Repository.

  6. In the Repository Information configuration wizard, you can set the Namespace , Repository Name , Repository Type , Summary , and Description , then click Next.

    Note

    The repository name must be 2 to 64 characters in length and can contain lowercase letters, digits, underscores (_), hyphens (-), and periods (.). The name cannot start or end with an underscore (_) or contain forward slashes (/).

  7. In the Code Source configuration wizard, configure the Code Source, Build Settings, and Build Rules, then click Create Image Repository.

    Parameter

    Description

    Code Source

    Select the code source.

    Important

    Before you select a code source, ensure that the instance is bound to a source code hosting platform. For more information, see Bind a source code hosting platform.

    Build Settings

    • Automatically Build Images When Code Changes: When a branch has code committed, the build rule is automatically triggered.

    • Build On Machines Outside China: The build is performed in data centers outside China. After the build is successful, the image is pushed to the specified region.

    • Do Not Use Cache: Each build forces a re-pull of the base dependency image, which may increase the build time.

    Build Rules

    After you create the image repository, go to the image building page to create image building rules. For more information, see Build repositories and images.

Step 5: push and pull an image

Beginning September 9, 2024, the endpoint for the new Personal Edition instance will be adjusted. For more information, see Limits on the new Personal Edition instance. Depending on your needs, you can select various methods to push and pull images.

Note

You may experience difficulties pulling images from outside China due to carrier network issues when utilizing the image accelerator feature. For more information, see [Product Change] Announcement on the adjustment of the ACR image accelerator feature.

Container Registry Personal Edition instance of the new version

  1. You can log on to Container Registry console, and select Repository Management > Access Credential on the Personal Edition instance management page to obtain the logon command.

    To log on to the image repository, run the following command.

    docker login --username=<username for logging on to the image repository> crpi-xxxx.cn-<region of the Personal Edition instance>.personal.cr.aliyuncs.com

    Enter the password you established in Step 2: Set a password for logging on to the Container Registry Personal Edition instance as shown in the result. If login succeeded is displayed, the logon has been successful.

  2. Push an image to the repository.

    1. To tag the image, run the following command.

      docker tag <image ID> crpi-xxxx.cn-<region of the Personal Edition instance>.personal.cr.aliyuncs.com/<namespace name>/<image repository name>:<image version number>
    2. To push the image to the Personal Edition instance, run the following command.

      docker push crpi-xxxx.cn-<region of the Personal Edition instance>.personal.cr.aliyuncs.com/<namespace name>/<image repository name>:<image version number>

      On the Image Repository page, click the name of the target image repository and select Image Version. On the Image Version page, the presence of the pushed image confirms that the image has been successfully pushed.

  3. Execute the command below to pull the image.

    docker pull crpi-xxxx.cn-<region of the Personal Edition instance>.personal.cr.aliyuncs.com/<namespace name>/<image repository name>:<image version number>

    Execute docker images. The displayed list of images will include the pulled image, confirming that it has been successfully retrieved.

Container Registry Personal Edition instance of the old version

  1. To log on to the image repository, run the following command: You can log on to Container Registry console or , navigate to Repository Management > Access Credential on the Personal Edition instance management page, and retrieve the logon command.

    docker login --username=<username for logging on to the image repository> registry.cn-<region of the Personal Edition instance>.aliyuncs.com

    Enter the password you established in Step 2: Set a password for logging on to the Container Registry Personal Edition instance when prompted. If login succeeded appears, the logon has been successful.

  2. Push an image to the repository.

    1. To tag the image, run the following command.

      docker tag <image ID> registry.cn-<region of the Personal Edition instance>.aliyuncs.com/<namespace name>/<image repository name>:<image version number>
    2. To push the image to the Personal Edition instance, run the following command.

      docker push registry.cn-<region of the Personal Edition instance>.aliyuncs.com/<namespace name>/<image repository name>:<image version number>

      On the Image Repository page, click the name of the target image repository and select Image Version. On the Image Version page, you can view the pushed image, which confirms that the image has been successfully pushed.

  3. To pull the image, run the following command.

    docker pull registry.cn-<region of the Personal Edition instance>.aliyuncs.com/<namespace name>/<image repository name>:<image version number>

    Execute docker images. If you see the pulled image in the results, it indicates a successful pull.

Related operations

Batch delete image versions

  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 Personal Edition instance that you want to manage.

  5. On the Personal Edition instance management page, select Repository Management > Image Repository, and click the name of the desired repository on the right side of the page.

  6. In the left-side navigation pane on the image repository details page, click Image Version.

  7. On the Image Version page, select the Version Batch Delete Batch Delete icon on the left, and click it.

  8. In the confirmation dialog box, select Confirm to Delete the Version of the Image, and click OK.