All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

Basic operations on the Docker registry

Last updated:2021-05-11 10:41:16

Activate the Docker registry

  1. Log in to the KCE console.
  2. In the left navigation pane, choose Image Repository > My Images. If you use the My Images feature for the first time, initialize the Docker registry and set a password for the Docker registry.
    • User Name: the ID of your Kingsoft Cloud account, which cannot be changed.
    • Password: the password that is used to log in to the Kingsoft Cloud Docker registry through docker login. The password can be customized. It must be 8 to 32 characters in length, and must contain at least two of the following types: letters, digits, and special characters. The special characters include !$% ()*+,–./:;<=>?@[]^_`{|}.

Create a namespace

Namespaces provide a scope for your private image addresses. Namespaces are used to group your container images.

  1. Log in to the KCE console.
  2. In the left navigation pane, choose Image Repository > Namespace.
  3. On the Namespace page, click Create Namespace.
  4. In the Create Namespace dialog box, set the following parameters:
    • Name: the name of the namespace. It can be customized. It must be 4 to 30 characters in length, and can contain lowercase letters, digits, underscores (_), and hyphens (-). The name cannot start or end with an underscore (_) or a hyphen (-).
    • Type: the type of the namespace. It determines the type of image repositories in the namespace.
  5. Click OK.

Create an image repository

  1. Log in to the KCE console.
  2. In the left navigation pane, choose Image Repository > My Images.
  3. On the My Images page, click Create Repository.
  4. In the Create Repository dialog box, set the following parameters:
    • Name: the name of the image repository. It must be 2 to 30 characters in length, and can contain lowercase letters, digits, underscores (_), and hyphens (-). The name cannot start or end with an underscore (_) or a hyphen (-).
    • Namespace: the namespace to which the image repository belongs.
    • Type: the type of the image repository, which is the same as that of the namespace.
    • Description: the description of the image repository.
  5. Click OK.

Push images to the Docker registry

Log in to the Kingsoft Cloud Docker registry

The region of Beijing is used as an example.

$ sudo docker login --username=[username] hub.kce.ksyun.com

username: the ID of your Kingsoft Cloud account. The login completes after you enter the password. The password is the one that you set when you activate the Docker registry.

Push an image

$ sudo docker tag [ImageId] hub.kce.ksyun.com/[namespace]/[ImageName]:[tag]
$ sudo docker push hub.kce.ksyun.com/[namespace]/[ImageName]:[tag]

ImageId: the actual image ID.

tag: the image version.

namespace: the name of the configured namespace.

ImageName: the name of the image created in the console.

Pull an image

$ sudo docker pull hub.kce.ksyun.com/[namespace]/[ImageName]:[tag]

tag: the version of the image that you want to pull.

On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback