AWS CLI 2 · Containers and secrets
Log Docker in to ECR
Authenticate Docker to a private registry. Use your own account ID and region.
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com
Official AWS CLI 2 documentation