Expected that your AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY is set or you have a proper profile in ~/.aws/credentials to be able to use awscli. I am expecting that your ECR repository exists, it is accessible by hostname account-id.dkr.ecr.region.amazonaws.com.
aws ecr get-login-password --region=us-east-2 | \ docker login --username AWS --password-stdin XXX.dkr.ecr.us-east-2.amazonaws.com
docker image ls docker tag bad666cafe XXX.dkr.ecr.us-east-2.amazonaws.com/repository docker push XXX.dkr.ecr.us-east-2.amazonaws.com/repository