To build images from source code, connect your Container Registry Enterprise Edition instance to a source code hosting platform.
Prerequisites
-
You have an account on a supported source code hosting platform.
-
You have created an Enterprise Edition instance. For Personal Edition instances, see Connect to a source code hosting platform.
Background information
Container Registry Enterprise Edition supports the following source code hosting platforms:
|
Code platform |
Platform version |
Connection method |
Build trigger limits |
|
Gitee Personal Edition instances are not supported. |
All |
Gitee OAuth authorization |
None |
|
GitHub |
Only personal accounts are supported. |
GitHub OAuth authorization |
None |
|
GitLab |
All |
personal access token |
None |
|
Bitbucket |
All |
Bitbucket OAuth authorization |
None |
Connect an Enterprise instance to Gitee
Log on to the Container Registry console.
In the top navigation bar, select a region.
-
In the left-side navigation pane, choose Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
-
On the instance management page, choose .
-
On the Code Source page, find Gitee and click Bind Account in the Actions column.
-
In the Gitee dialog box, click Go to the source code repository to bind account.
-
On the Gitee sign-in page, enter your username and password, and then click Logon.
-
On the Gitee authorization page, confirm the authorization information and click Confirm Authorization Policy.
You are redirected to the Container Registry console, and a message appears indicating that you have successfully connected your Gitee account.
Connect an Enterprise instance to GitHub
Log on to the Container Registry console.
In the top navigation bar, select a region.
-
In the left-side navigation pane, choose Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
-
On the instance management page, 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 sign-in page, enter your credentials and click Sign in.
-
On the Authorize Aliyun Container Registry page, confirm the authorization information and click Authorize AliyunDeveloper.
You are redirected to the Container Registry console, and a message appears indicating that you have successfully connected your GitHub account.
Connect an Enterprise instance to Bitbucket
Log on to the Container Registry console.
In the top navigation bar, select a region.
-
In the left-side navigation pane, choose Instances.
On the Instances page, click the Enterprise Edition instance that you want to manage.
-
On the instance management page, 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 login page, enter your email, username, and password as prompted, and then click Logon.
-
On the Bitbucket authorization page, confirm the authorization information and click Grant access.
-
In the Bind Account dialog box, select the Instance Edition, Region, and Instance. Then, click Confirm.
On the Code Source page, if Bound is displayed in the Status column for Bitbucket, the connection is successful.
Connect an Enterprise instance to GitLab
If you use a self-managed GitLab instance, note the following port requirements:
-
HTTP service
By default, port 80 is used. To use a different port, you must manually append the port number to the trigger URL. You can use only the following ports: 80, 21, 443, 70, 210, 280, 488, 591, 777, and ports from 1025 to 65535.
-
HTTPS service
By default, port 443 is used. Only the default port 443 is supported. If you want to use a different port, use the HTTP service.
Connecting to GitLab instances that are behind a firewall or use a self-signed HTTPS certificate is not supported. To connect to a private GitLab instance within a VPC, see Build container images by using the secure build mode for VPCs.
-
Create a personal access token in GitLab.
-
Log on to GitLab with an administrator account.
-
On the GitLab page, click your profile avatar and select Settings.
-
In the left-side navigation pane of the User Settings page, click Access Tokens.
-
On the Access Tokens page, set a name and expiration date, and then click Create personal access token.
After an access token is successfully created, you can view it on the Access Tokens page. The page displays the generated personal access token. Click the copy button to save the token value. This token is displayed only once and cannot be viewed again after you leave the page.
-
-
Connect the GitLab platform.
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 Enterprise Edition instance that you want to manage.
-
On the instance management page, choose .
-
On the Code Source page, find GitLab and click Bind Account in the Actions column.
-
In the dialog box that appears, set the parameters and click Confirm.
-
Endpoint: Enter the login URL of your GitLab instance.
-
If you use a self-managed GitLab instance, enter its login URL.
-
If you use the public GitLab service, enter its login URL.
-
-
Username: Enter your GitLab username.
-
Private Token: Enter the personal access token that you created in Step 1.
On the Code Source page, if Bound is displayed in the Status column for GitLab, the connection is successful.
-
Related documents
If the connection to a source code hosting platform fails, see FAQ about source code repositories for troubleshooting steps.