When you build images, you need to bind a source code hosting platform. This topic describes how to bind a Container Registry Enterprise Edition instance to a source code hosting platform. This facilitates subsequent operations such as image building.

Prerequisites

Background information

Alibaba Cloud Container Registry Enterprise Edition supports the following five code hosting platforms. You can bind your instance to Alibaba Cloud Code, Gitee, and GitHub in a similar way. This topic provides an example on how to bind an instance to GitHub.
Code hosting platform Edition Binding method Limits on triggering image building
GitHub Individual Edition OAuth authentication None
GitLab All editions Personal access token None
Alibaba Cloud Code All editions OAuth authentication An image build is not automatically triggered when the code changes.
Gitee All editions OAuth authentication None

Bind a Container Registry Enterprise Edition instance to GitLab

Note You cannot access GitLab over a firewall or through a self-signed HTTPS certificate. Make sure that GitLab is accessible over the Internet.
  1. Obtain an access token for GitLab.
    1. Log on to GitLab.
    2. On the GitLab page, click the profile picture and then click Settings.
    3. On the User Settings page, click Access Tokens in the left-side navigation pane.
    4. On the Access Tokens page, set the Name and Expires At parameters, select api, and then click Create Personal Access Token.
      Then, you can view the access token on the Access Tokens page. GitLab
  2. Bind your instance to GitLab.
    1. Log on to the Container Registry console.
    2. In the top navigation bar, select a region.
    3. In the left-side navigation pane, click Instances.
    4. On the Instances page, click the required Container Registry Enterprise Edition instance.
    5. On the management page of the Container Registry Enterprise Edition instance, choose Repositories > Code Source in the left-side navigation pane.
    6. On the Code Source page, find GitLab and click Bind Account in the Actions column.
    7. In the Private GitLab dialog box, set the following parameters and click Confirm.
      • URL: the URL that is used to log on to GitLab.
        • If you use a private GitLab, enter the logon URL of the private GitLab.
        • If you use a public GitLab, enter the logon URL of the public GitLab.
      • Username: the username that is used to log on to GitLab.
      • Private Token: the access token that is created in Step 1.
      If Bound is displayed in the Status column on the Code Source page, the instance is bound to GitLab.
      Note If the binding fails, you can view related topics to locate failure causes. For more information, see Create a GitLab source code repository.

Bind a Container Registry Enterprise Edition instance to GitHub

  1. Log on to GitHub.
  2. Log on to the Container Registry console.
  3. In the top navigation bar, select a region.
  4. In the left-side navigation pane, click Instances.
  5. On the Instances page, click the required Container Registry Enterprise Edition instance.
  6. On the management page of the Container Registry Enterprise Edition instance, choose Repositories > Code Source in the left-side navigation pane.
  7. On the Code Source page, find GitHub and click Bind Account in the Actions column.
  8. In the GitHub dialog box, click Go to the source code repository to bind account.
    If the You have successfully bound the GitHub account message is displayed, the instance is bound to GitHub.