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

Prerequisites

Background information

Alibaba Cloud Container Registry Enterprise Edition supports the following code hosting platforms.
Code hosting platform Edition Authentication method for binding Limit on triggering image building
Gitee All OAuth authentication None
GitHub GitHub developer version OAuth authentication None
GitLab All Personal access token None

Bind a Container Registry Enterprise Edition instance to Gitee

  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 Repository > Code Source in the left-side navigation pane.
  6. On the Code Source page, find Gitee and click Bind Account in the Actions column.
  7. In the Gitee dialog box, click Go to the source code repository to bind account.
  8. On the Gitee logon page, enter your account and password, and then click Log In.
  9. On the Gitee Authorization page, verify the authorization information and click Permit.
    Return to the Container Registry console. If Bind successfully is displayed, the Enterprise Edition instance is bound to Gitee.

Bind a Container Registry Enterprise Edition instance to GitHub

  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 Repository > Code Source in the left-side navigation pane.
  6. On the Code Source page, find GitHub and click Bind Account in the Actions column.
  7. In the GitHub dialog box, click Go to the source code repository to bind account.
  8. On the GitHub logon page, enter your account and password, and then click Sign in.
  9. On the Authorize Aliyun Container Registry page, verify the authorization information and click Authorize AliyunDeveloper.
    Return to the Container Registry console. If the message You have successfully bound the GitHub account is displayed, the Enterprise Edition instance is bound to GitHub.

Bind a Container Registry Enterprise Edition instance to GitLab

If you bind a self-managed GitLab source code repository, take note of the following items about ports:
  • HTTP

    By default, port 80 is used. If you want to use another port, append the port number to the end of the trigger URL. You can use only the following port numbers: 80, 21, 443, 70, 210, 280, 488, 591, 777, and from 1025 to 65535.

  • HTTPS

    By default, port 443 is used. Only port 443 is supported. If you want to use another port, use HTTP.

Note You cannot access GitLab over a firewall or through a self-signed HTTPS certificate. Make sure that GitLab can be accessed over the Internet.
  1. Create an access token for GitLab.
    1. Log on to GitLab.
    2. On the GitLab page, click the profile picture and 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 Repository > 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 troubleshoot the issue. For more information, see FAQ about source code repositories.

References

If your Container Registry Personal Edition instance fails to be bound to a source code hosting platform, you can view related topics to troubleshoot the issue. For more information, see FAQ about source code repositories.