Container Registry Personal Edition provides image hosting for Docker images. Use it to push images from your local environment to a repository and let others pull them from the same repository.
Prerequisites
Before you begin, make sure you have:
-
A Container Registry Personal Edition instance. See Create a Container Registry Personal Edition instance.
-
Docker installed. See Install Docker.
-
A source code hosting platform bound to the instance, or a locally built image. See Bind a source code hosting platform and Build and push a multi-arch image on an on-premises device to a Container Registry Enterprise Edition instance.
Step 1: Get your username
Your username depends on the account type you use to log on to Container Registry.
-
Log on to the Container Registry consoleContainer Registry consoleContainer Registry console. In the top navigation bar, select a region.
-
In the left-side navigation pane, choose Repository > Access Credential.
-
Find your username:
-
Alibaba Cloud account: the account name is your username.
-
Resource Access Management (RAM) user: the string before
aliyundoc.comis your username. For example, if your RAM user name isXXX@10051309672**.onaliyun.com`, your username is `XXX@10051309672**.
-
Step 2: Set a logon password
Set a password for the first time
The first time you log on to the Container Registry console, set a logon password to enable image uploads and downloads.
-
Log on to the Container Registry consoleContainer Registry consoleContainer Registry console.
-
On the Instances page, click the Personal Edition instance you want to manage.
-
In the Tips dialog box, click Activate Now, then click Reset Docker Login Password.
-
In the Reset Docker Login Password dialog box, enter and confirm your password, then click Confirm.
Log on to the Container Registry console.
Reset a forgotten password
-
Log on to the Container Registry consoleContainer Registry consoleContainer Registry console. In the top navigation bar, select a region.
-
In the left-side navigation pane, click Instances.
-
On the Instances page, click the Personal Edition instance you want to manage.
-
In the left-side navigation pane, choose Repository > Access Credential.
-
On the Access Credential page, click Set Password and follow the prompts.
Log on to the Container Registry console.
Log on to the Container Registry console.
Log on to the Container Registry console.
The GetAuthorizationToken operation cannot retrieve a temporary username or token for Personal Edition instances. Use a password to log on.
Step 3: Create a namespace
A namespace groups related repositories together and lets you manage permissions and attributes at the namespace level.
-
Log on to the Container Registry consoleContainer Registry consoleContainer Registry console. In the top navigation bar, select a region.
-
In the left-side navigation pane, click Instances.
-
On the Instances page, click the Personal Edition instance you want to manage.
-
In the left-side navigation pane, choose Repository > Namespace.
-
On the Namespace page, click Create Namespace.
-
Enter a name for the namespace, then click Confirm.
Step 4: Create an image repository
-
Log on to the Container Registry consoleContainer Registry consoleContainer Registry console. In the left-side navigation pane, click Instances.
-
On the Instances page, click the Personal Edition instance you want to manage.
-
In the left-side navigation pane, choose Repository > Repositories.
-
On the Repositories page, click Create Repository.
-
In the Repository Info step, configure the following parameters, then click Next.
Parameter Description Namespace The namespace to place the repository in. Repository Name A name for the repository. Must be 2–64 characters and can contain lowercase letters, digits, underscores ( _), hyphens (-), and periods (.). Cannot start or end with an underscore, and cannot contain forward slashes (/).Repository Type The visibility of the repository. Summary A short description of the repository. Description A detailed description of the repository. -
In the Code Source step, configure the following parameters, then click Create Repository.
Parameter Description Code source The source code hosting platform to link to this repository. Before selecting a code source, make sure the instance is bound to a source code hosting platform. See Bind a source code hosting platform. Build Settings Controls when and how images are built: Automatically Build Images When Code Changes triggers a build when code is committed from a branch; Build with Servers Deployed Outside Chinese Mainland builds images in a data center outside the Chinese mainland then pushes them to the specified region; Build Without Cache pulls the base image each time, which may slow the build. Build Rules After creating the repository, configure build rules on the image building page. See Create a repository and build images. Log on to the Container Registry console.
Step 5: Push and pull an image
ACR adjusted the Personal Edition instance creation process starting September 9, 2024. The registry endpoint format differs between new and old instances. See Limits on new Personal Edition instances to check which version applies to you.
Image accelerators cannot guarantee successful pulls of specific image versions due to unstable ISP network connections. See \[Product update\] Announcement on the adjustment of the image accelerator feature of Container Registry.
Image name format
All push and pull commands use a fully qualified image name in this format:
<registry-endpoint>/<namespace>/<repository>:<tag>
| Component | Description | Example |
|---|---|---|
registry-endpoint |
The domain of your registry instance | crpi-xxxx.cn-hangzhou.personal.cr.aliyuncs.com |
namespace |
The namespace you created in Step 3 | my-namespace |
repository |
The repository name you created in Step 4 | my-app |
tag |
A label identifying the image version | v1.0 |
The registry endpoint format depends on your instance version:
| Instance version | Registry endpoint format |
|---|---|
| New (created after September 9, 2024) | crpi-xxxx.cn-<region-id>.personal.cr.aliyuncs.com |
| Old (created before September 9, 2024) | registry.cn-<region-id>.aliyuncs.com |
To get your exact registry endpoint and the login command, go to Repository > Access Credential in the Container Registry console.
New instance (created after September 9, 2024)
Log on to the registry
Run the following command, replacing the endpoint with the one from Access Credential:
docker login --username=<username> crpi-xxxx.cn-<region-id>.personal.cr.aliyuncs.com
Enter the password you set in Step 2. A login succeeded message confirms the logon.
Push an image
Tag the local image with the full registry path, then push it:
# Tag the image
docker tag <image-id> crpi-xxxx.cn-<region-id>.personal.cr.aliyuncs.com/<namespace>/<repository>:<tag>
# Push to the registry
docker push crpi-xxxx.cn-<region-id>.personal.cr.aliyuncs.com/<namespace>/<repository>:<tag>
To verify, open the repository in the Container Registry console, go to the Tags page, and confirm the image tag appears. Alternatively, run docker images to see the image locally:
REPOSITORY TAG IMAGE ID CREATED SIZE
crpi-xxxx.cn-<region-id>.personal.cr.aliyuncs.com/<namespace>/<repository> <tag> abc123def456 2 minutes ago 512MB
Pull an image
docker pull crpi-xxxx.cn-<region-id>.personal.cr.aliyuncs.com/<namespace>/<repository>:<tag>
To verify, run docker images and confirm the image appears in the output.
Old instance (created before September 9, 2024)
Log on to the registry
docker login --username=<username> registry.cn-<region-id>.aliyuncs.com
Enter the password you set in Step 2. A login succeeded message confirms the logon.
Push an image
# Tag the image
docker tag <image-id> registry.cn-<region-id>.aliyuncs.com/<namespace>/<repository>:<tag>
# Push to the registry
docker push registry.cn-<region-id>.aliyuncs.com/<namespace>/<repository>:<tag>
To verify, open the repository in the Container Registry console, go to the Tags page, and confirm the image tag appears.
Pull an image
docker pull registry.cn-<region-id>.aliyuncs.com/<namespace>/<repository>:<tag>
To verify, run docker images and confirm the image appears in the output.
What's next
Delete multiple image tags
-
Log on to the Container Registry consoleContainer Registry consoleContainer Registry console. In the top navigation bar, select a region.
-
In the left-side navigation pane, click Instances.
-
On the Instances page, click the Personal Edition instance you want to manage.
-
In the left-side navigation pane, choose Repository > Repositories.
-
On the Repositories page, click the repository whose tags you want to delete.
-
In the left-side navigation pane, click Tags.
-
On the Tags page, select the tags to delete, then click Batch Delete.
-
In the dialog box, select I am sure to delete the images of these tags, then click OK.