Image Registry User Guide

Last updated: 2020-11-25 11:49:12

    Overview

    Image Registry is used to store Docker images, which are used to deploy TKE. Each image has a unique ID (image repository address + image name + image tag). Currently, Docker Hub official images and users’ private images are supported.

    Directions

    Activating Image Registry

    Note:

    When using Image Registry for the first time, you need to activate the service.

    1. Log in to the TKE console and choose Image Registry > My Images in the left sidebar.


    2. Complete required information based on the following instructions and click Enable to start initialization.

    • Username: defaults to the current user’s Account ID for logging in to Tencent Cloud Docker Image Registry. You can obtain the username on the Account Information page.
    • Password: is the credential for logging in to Tencent Cloud Docker Image Registry.

      Note:

      Record the username and password, which will be used to push and pull images.

    Creating a namespace

    1. Choose Image Registry > My Images in the left sidebar to go to the "My Images" page.
    2. On the "My Images" page, select the Namespace tab and click Create, as shown in the figure below:
    3. In the "Create a Namespace" window that appears, enter the namespace name and click Submit, as shown in the figure below:

      Note:

      • The namespace name must be unique in the region to which the namespace belongs. If the namespace name that you want to use is already used by another user, try another name.
      • At the top of the My Images page, select a region from the list.

    Creating an image

    1. Choose Image Registry > My Images in the left sidebar to go to the "My Images" page.
    2. On the "My Images" page, click Create above the image list, as shown in the figure below:
    3. Enter the image name and description, and then click Submit.

      Note:

      The namespace is used to classify container images. It is also the prefix of the addresses of private images that you create. This document uses tkefiletest as an example.

    Pushing an image to Image Registry

    Note:

    Image addresses vary slightly with different regions. In the following steps, the image address of the default region is used as an example. In real-world cases, replace the image address with the correct one. You can query the actual image address on the My Images page.

    Logging in to Tencent Cloud Registry

    1. On a client, replace the variable in the following command with the actual one and run the command to log in to Tencent Cloud Registry.
      $ sudo docker login --username=[username] ccr.ccs.tencentyun.com

    username: refers to Tencent Cloud Account ID, which is registered upon service activation. You can obtain the username on the Account Information page.
    2. Enter the password that you set when activating image registry to complete login.

    Uploading an image

    Replace the variables in the following commands and run them to upload the image.

    $ sudo docker tag [ImageId] ccr.ccs.tencentyun.com/[namespace]/[ImageName]:[Image tag]
    $ sudo docker push ccr.ccs.tencentyun.com/[namespace]/[ImageName]:[Image tag]
    • ImageId and Image tag: enter them based on existing image information.
    • namespace: indicates the namespace that you entered when activating Image Repository.
    • ImageName: indicates the image name created in the console.

    Downloading an image

    1. Run the following command to log in to Image Repository. In this step, you need to enter the password that you set when activating Image Registry.
      $ sudo docker login --username=[username] ccr.ccs.tencentyun.com
    2. Replace the variable in the following command and run the command to download the image.
      $ sudo docker pull ccr.ccs.tencentyun.com/[namespace]/[ImageName]:[Image tag]

    Deleting an image

    1. Choose Image Registry > My Images in the left sidebar to go to the "My Images" page.
    2. On the "My Images" page, click Delete for the target image.
    3. In the "Delete Image Repository" window that appears, click OK to delete all tags of the image, as shown in the figure below:

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help