Before you build an image, you must bind your Container Registry instance to a source code hosting platform. This topic describes how to bind a Container Registry Personal Edition instance to a source code hosting platform. After the instance is bound, you can perform operations such as image building.
Prerequisites
An account is registered on the source code hosting platform.
A Container Registry Personal Edition instance is created. For more information, see Create a Container Registry Personal Edition instance.
Background information
Container Registry Personal Edition supports the following source code hosting platforms.
Code hosting platform | Version of the code hosting platform | Authentication method for binding | Limit on triggering image building |
GitHub | GitHub developer version | GitHub OAuth authentication | None |
Bitbucket | All | Bitbucket OAuth authorization | None |
GitLab | All regions | Personal access token | None |
Bind a Container Registry Personal Edition instance to GitHub
Log on to the Container Registry console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Instances.
On the Instances page, click the Personal Edition instance that you want to bind.
In the left-side navigation pane of the management page of the Container Registry Personal Edition instance, choose .
On the Code Source page, find GitHub and click Bind Account in the Actions column.
In the GitHub dialog box, click Go to the source code repository to bind account.
On the GitHub logon page, enter your account and password, and then click Sign in.
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 Personal Edition instance is bound to GitHub.
Bind a Container Registry Personal Edition instance to Bitbucket
Log on to the Container Registry console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Instances.
On the Instances page, click the Personal Edition instance that you want to bind.
In the left-side navigation pane of the management page of the Container Registry Personal Edition instance, choose .
On the Code Source page, find Bitbucket and click Bind Account in the Actions column.
In the Bitbucket dialog box, click Go to the source code repository to bind account.
On the Bitbucket logon page, enter your email address, click Continue, enter your password, and then click Sign in.
On the Confirm access to your account page, confirm that the permissions to be granted are correct and click Grant access.
Return to the Container Registry console. If the message You have successfully bound the Bitbucket account is displayed, the instance is bound to Bitbucket.
Bind a Container Registry Personal Edition instance to GitLab
To bind the instance to 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 other ports, append the port numbers 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 number, use HTTP.
You cannot access GitLab over a firewall or by using a self-signed HTTPS certificate. Make sure that GitLab can be accessed over the Internet.
If your Personal Editon instance is bound to a GitLab code repository in a GitLab subgroup, image building can only be manually triggered.
Create an access token for GitLab.
Log on to GitLab.
On the GitLab page, click the profile picture and click Settings.
In the left-side navigation pane of the User Settings page, click Access Tokens.
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.
Bind your instance to GitLab.
Log on to the Container Registry console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Instances.
On the Instances page, click the Personal Edition instance that you want to bind.
In the left-side navigation pane of the management page of the Container Registry Personal Edition instance, choose .
On the Code Source page, find GitLab and click Bind Account in the Actions column.
In the Private GitLab dialog box, configure 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 you use to log on to GitLab.
Private Token: the access token that you created.
If Bound is displayed in the Status column on the Code Source page, the instance is bound to GitLab.
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.