tencent cloud

Feedback

Upload Docker Images to Tencent Container Image Repository (TCR)

Last updated: 2024-10-22 16:05:05

    Type 1: Personal Account

    1. Log in to Tencent Cloud Container Registry
    Replace relevant information in the following command at the terminal and execute it. Log in to the Tencent Cloud Container registry.
    $ sudo docker login --username=[username] ccr.ccs.tencentyun.com
    Username: Tencent CloudAccount ID, which is registered when activated and can be obtained in the Account Information page.
    Input the password set when activating the image repository to complete the log-in.
    Note:
    When you use sudo instructions to execute docker log-in, the system will prompt you to enter the host administrator password required by sudo first. After entering it correctly, ensure that there is no error message and enter the correct image repository log-in password again for successful log-in.
    2. Upload Image
    Replace the information in the command according to the following prompts and execute it to upload the image.
    $ sudo docker tag [ImageId] ccr.ccs.tencentyun.com/[namespace]/[ImageName]:[Image Version Number]
    $ sudo docker push ccr.ccs.tencentyun.com/[namespace]/[ImageName]:[Image Version Number]
    ImageId: The ID of the local image to be uploaded can be viewed through Docker Image ls.
    Image Tag: The image version or tag of the image when uploading the local image to the image repository.
    Namespace: The namespace to be filled in when you open the image repository.
    ImageName : the name of the image created in the console
    For other image operations, see documentation.

    Type II: Enterprise Account

    1. Log in to a Registry instance
    Click Access Credential in the left sidebar to enter the list page of Access Credential. Select the newly created instance and click Generate Temporary Login Command.
    In the pop-up Temporary Login Command window, click Copy Login Command.
    Execute the obtained login instruction in the Tencent Cloud Command Line Interface to log in to the instance. Example:
    sudo docker login demo-tcr.tencentcloudcr.com --username 1xxx1019xxxx --password eyJhbGciOiJSUzI1NiIsImtpZCI6IlZCVTY6VTVGVzpP...
    If Login Succeeded is displayed in the Tencent Cloud Command Line Interface, it indicates that the log in was successful.
    2. Push Container Image
    You can build a new container image locally or get a public image from DockerHub for testing. This document takes the latest official Nginx image from DockerHub as an example. Execute the following commands in the Tencent Cloud Command Line Interface to push the image. Replace demo-tcr, project-a, and nginx with the instance name, namespace name, and image repository name that you actually created.
    sudo docker tag nginx:latest demo-tcr.tencentcloudcr.com/project-a/nginx:latest
    sudo docker push demo-tcr.tencentcloudcr.com/project-a/nginx:latest
    3. Pull Container Image
    Taking the successfully pushed Nginx image as an example, execute the following command in the command line to pull the image.
    sudo docker pull demo-tcr.tencentcloudcr.com/project-a/nginx:latest
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support