Your Authorization Token has expired when trying to push to ECS docker repository

The Error

denied: Your Authorization Token has expired. Please run 'aws ecr get-login' to fetch a new one.

This is just for storing the command below. Every time I want to do a docker push to my ECS repo, I need get the denied error if I’m working in the wrong region. You must run the get-login command for the region your repo is in. Also, don’t forget to copy and run the command that’s returned, it does not run automatically.

The Fix

aws ecr get-login --region us-west-2

Login using the –region tag, changing the region to the region your docker repo is in.

Share this:

Leave a comment

five × three =