Elastic Container Registry

Amazon Elastic Container Registry (ECR) is a fully-managed Docker container registry that makes it easy for developers to store, manage, and deploy Docker container images.

Registry

Create ECR Repository from the AWS Console, example: lexicon-webmvc

1
2
000000000000.dkr.ecr.ap-southeast-2.amazonaws.com/lexicon-webmvc
This is the same as a docker hub image: microsoft/mssql-server-linux:2017-CU13

Push image from Local

Updated 05/04/2022

Use the CLI to generate your login command

CLI V2

get-login-password is the new command and I am piping the response into the next docker login command which is then read with --password-stdin

1
2
3
aws --profile carlos ecr get-login-password --region ap-southeast-2 | docker login --username AWS --password-stdin 000000000000.dkr.ecr.ap-southeast-2.amazonaws.com
docker tag spa-image:30April2022a 000000000000.dkr.ecr.ap-southeast-2.amazonaws.com/spa-image:latest
docker push 000000000000.dkr.ecr.ap-southeast-2.amazonaws.com/spa-image:latest

CLI V1

1
2
3
4
aws ecr get-login --no-include-email --region ap-southeast-2
docker login -u AWS -p [MASSIVE ENCRIPTED BLOB] https://000000000000.dkr.ecr.ap-southeast-2.amazonaws.com
docker tag docker-compose-lexicon_lexicon-webmvc 000000000000.dkr.ecr.ap-southeast-2.amazonaws.com/lexicon-webmvc
docker push 000000000000.dkr.ecr.ap-southeast-2.amazonaws.com/lexicon-webmvc

Now the image will be available at the ECR.

References