aws ecr get-login-password --region
aws ecr get-login-password --region <region> | docker login --username AWS --password-stdin <account>.dkr.ecr.<region>.amazonaws.com
Risk: Safe
What it does
Gets a short-lived ECR password and hands it to docker login.
When to use it
Before docker push or pull with ECR. The token lasts 12 hours.
Example
$ aws ecr get-login-password --region ap-southeast-5 | docker login --username AWS --password-stdin 111122223333.dkr.ecr.ap-southeast-5.amazonaws.comLog Docker in to your shelf. The password never shows.
Learn it in: ECR: your image shelf · Official docs