By default, Container Registry Enterprise Edition instances are accessible only through Alibaba Cloud-assigned domain names. Adding a custom domain name with an SSL certificate lets you access your instance over HTTPS from a domain you control.
Prerequisites
Before you begin, ensure that you have:
An SSL certificate uploaded to SSL Certificate Service. The certificate secures HTTPS access using transport-layer encryption and authentication. Domain name certificates support TLS 1.1 and TLS 1.2. To purchase or upload a certificate, see Purchase a commercial SSL certificate. If you obtained a certificate from a third-party certificate authority before using SSL Certificate Service, upload it first. For more information, see Upload, synchronize, and share an SSL certificate
Alibaba Cloud DNS activated. DNS routes requests for your custom domain name to the instance's IP addresses. See Activate Alibaba Cloud DNS PrivateZone
Alibaba Cloud DNS routes requests for a custom domain name to the corresponding IP addresses of a Container Registry Enterprise Edition instance. For more information, see Activate Alibaba Cloud DNS PrivateZone.
RAM access control configured for custom domain names. Create a Resource Access Management (RAM) role and grant it permissions to manage SSL certificates so Container Registry can access the certificate on your behalf. See Configure RAM access control for using a custom domain name
Add a custom domain name
Each Container Registry Enterprise Edition instance has two default domain names: a public domain name and a virtual private cloud (VPC) domain name. Custom domain names are additional domain names you configure.
Log on to the Container Registry console.
In the top navigation bar, select the region where your instance is located.
On the Instances page, click the Enterprise Edition instance you want to manage.
In the left navigation pane, choose Repository > Domain.
On the Domain Name Management page, click Add Domain Name.
In the Add Domain Name dialog box, select a Domain Name and a Certificate ID, then click Confirm.
Configure DNS resolution
After adding the custom domain name, configure DNS resolution to point the domain to your instance. Choose the access type that matches how clients connect to your instance.
DNS record reference
Access type | Record type | Hostname | Record value | TTL |
Public access | CNAME | Your custom domain name | Default public domain name of the instance | 10 minutes (default) |
VPC access | CNAME | @ | Default VPC domain name of the instance | Default |
Set up public access
Configure public access control for your instance. See Configure public access control.
Log on to the Alibaba Cloud DNS console.
In the left navigation pane, click Public Zone.
On the Public Zone page, click Add Zone. In the Add Zone dialog box, enter your custom domain name and click OK.
Find the domain name you added and click DNS Settings in the Actions column.
On the DNS Settings page, click Add Record.
In the Add Record dialog box, set the following parameters:
Parameter
Value
Record type
CNAME
Hostname
Your custom domain name
Resolution request source
Default
Record value
Default public domain name of your instance
TTL
10 minutes (default)
Click OK.
After the DNS record is added, the instance is accessible over the Internet through the custom domain name.
Set up VPC access
Configure VPC access control for your instance. See Configure VPC access control.
Log on to the Alibaba Cloud DNS console.
In the left navigation pane, click Private Zone.
On the Authoritative Zone tab, click Add Zone.
In the Add Authoritative Zone dialog box:
Enter your custom domain name (for example,
www.example.com) in the Authoritative Zone field.Select Recursive Resolution Proxy for Subdomain Names.
Click OK.
On the Authoritative Zone tab, find the zone you created and click DNS Settings in the Actions column.
On the DNS Records tab, click Add Record.
In the Add Record dialog box, set the following parameters:
Parameter
Value
Record type
CNAME
Hostname
@
Record value
Default VPC domain name of your instance
TTL value
Default
Click OK.
Go back to the Private Zone (Compatible with on-premises DNS) page. On the Authoritative Zone tab, find the zone and click Scope Settings in the Actions column.
In the Scope Settings panel, under Effective In Alibaba Cloud VPCs, select the VPC you configured in step 1 and click OK.
After the Scope column shows data for the zone, the instance is accessible from within the associated VPC through the custom domain name.