if you run $(aws ecr get-login --region us-east-1) it will be all done for you
Update July 2021:
get-login is now deprecated in version 1 of the AWS CLI. If you’re using version 2 of the AWS CLI, you must use get-login-password.
You can pipe the output of get-login-password to your docker login command to authenticate docker to your ECR registry:
aws ecr get-login-password | docker login --username AWS --password-stdin ####.dkr.ecr.us-east-1.amazonaws.com
Now you should be able to docker push and have it go straight to your ECR registry.