This document describes how to initialize a Tencent Container Registry (TCR) Individual instance, configure a namespace, and push and pull container images.
To use TCR Enterprise, please see Quick Start.
If you already have a Tencent Cloud account, ignore this step.
Log in to the Tencent Cloud console, select Tencent Cloud services > Tencent Container Registry to enter the TCR console, activate TCR and authorize permissions to it according to the prompts. If you have already authorized permissions to TCR, skip this step.
Log in to the TCR console and go to the “Instance Management” page.
Select the region where you want to use the service. Currently, TCR Individual service is only deployed in Guangzhou throughout the Chinese mainland and supports cross-region access through private network in the regions such as Beijing, Shanghai and Chengdu. In this document, we take a TCR Individual instance in Guangzhou region as an example.
Check the tab of TCR Individual instance in the region, and click Initialize Password to set the password for accessing TCR Individual service. You can reset the password by clicking More > Reset the login password.
After the initialization of the login password is completed, you can click Log In to Instance to have the guidance on login of TCR Individual.
docker login ccr.ccs.tencentyun.com --username=xxxxxxxxx
"username" is the current Tencent Cloud account ID.
Run this login command in the command line tool, and enter the password. The login is successful if
Login Succeeded is displayed.
Namespaces are used to manage image repositories in the instance. They do not directly store container images, but can map to teams, product projects, or other custom layers in an enterprise.
After creating a namespace, you can use the Docker client to push images to the namespace, and the corresponding image repository will be automatically created.
After completing the preceding steps, you have created a namespace and image repository. Next, you can perform the following operations to push an image to or pull an image from the image repository.
You need to use a CVM or physical machine that has installed the Docker.
You can create a container image on the local server or obtain a public image from Docker Hub for testing.
This document uses the official and latest Nginx image on Docker Hub as an example. In the command line tool, run the following commands sequentially to push this image. Replace
nginx with the actual namespace and image repository names you have created.
sudo docker tag nginx:latest ccr.ccs.tencentyun.com/project-a/nginx:latest
sudo docker push ccr.ccs.tencentyun.com/project-a/nginx:latest
This document uses the successfully pushed Nginx image as an example. In the command line tool, run the following command to pull this image:
sudo docker pull ccr.ccs.tencentyun.com/project-a/nginx:latest