Amazon Elastic Container Repositories (ECR) have quite human-unfriendly URIs, like 99999999999.dkr.ecr.eu-west-1.amazonaws.com
. Is it at all possible to configure custom domain name for an ECR?
Simplistic solution would be to create a CNAME record to point to the ECR URI, but this doesn't really work (SSL certificate doesn't match the domain name, passwords generated by aws ecr get-login
don't pass, cannot push images tagged with custom domain name...).
Are there other options?
Sign in to the AWS Management Console and open the Amplify console . Choose your app that you want to add a custom domain to. In the navigation pane, choose App Settings, Domain management. On the Domain management page, choose Add domain.
To authenticate Docker to an Amazon ECR registry with get-login-password, run the aws ecr get-login-password command. When passing the authentication token to the docker login command, use the value AWS for the username and specify the Amazon ECR registry URI you want to authenticate to.
The primary difference between Amazon ECR and ECS is that while ECR provides the repository that stores all code that has been written and packaged as a Docker image, the ECS takes these files and actively uses them in the deployment of applications.
You must have a registered internet domain name in order to set up custom domain names for your APIs. If needed, you can register an internet domain using Amazon Route 53 or using a third-party domain registrar of your choice.
When you create a custom domain name for a regional API, API Gateway creates a regional domain name for the API. You must set up a DNS record to map the custom domain name to the regional domain name for API requests bound for the custom domain name to be routed to API Gateway through the mapped regional API endpoint.
For an edge-optimized custom domain name, the ACM certificate must be in the following Region: US East (N. Virginia) (us-east-1). For a Regional custom domain name, the ACM certificate must be in the same Region as your API. For REST APIs, follow the instructions in Setting up custom domain names for REST APIs.
Each certificate stored in ACM is identified by its ARN. To use an AWS managed certificate for a domain name, you simply reference its ARN. ACM makes it straightforward to set up and use a custom domain name for an API.
Unfortunately, AWS does not support custom domain names for ECR. You'll have to make do with the auto-generated ones for now. There are 'hacks' about, which centre around Nginx proxies, but it really isn't worth the effort.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With