The ability to push an image into AWS ECR requires a user with the ability to access AWS CLI. The user must have MFA associated with their user account. 

https://repost.aws/knowledge-center/authenticate-mfa-cli


If using local configuration files in <userhome>/.aws/ ensure that the profiles leveraged (–profile <default or other>) are present in both the config file (containing the appropriate region) and the credentials file.


aws sts get-session-token --duration-seconds 7200 --serial-number <mfa-arn> --token-code <mfa token>
CODE


set environment variables

set AWS_ACCESS_KEY_ID=<accesskeyid>
set AWS_SECRET_ACCESS_KEY=<secretaccesskey>
set AWS_SESSION_TOKEN=<sessiontoken>
CODE



aws ecr get-login-password --region <region> | docker login --username AWS --password-stdin <ecr-repository>  
CODE


ecr repository hint <acctnumber>.dkr.ecr.<region>.amazonaws.com