Docker push to ECR failing with "no basic auth credentials"

What is aws configure supposed to do? It seem to exist with status 255, which makes your pipeline fail.

Unrelated note: you might want to enable caching for the ~/.m2 folder of your pipeline to preven all dependencies to be pulled on every build.

Generaly the post is off-topic, as it is a problem within build specs of a AWS Code Build job.

Has anyone solved this problem on a Windows OS? I tried all the suggestions but none work and the ecr-credentials-helper doesn’t work for me as it’s not Win OS. :frowning:

Check that you ECR repository’s region is the same from the allowed user’s region. That was my case.

Hello spotit3156,

Thanks for the help. This --no-include-email has saved my life.

I had this issue and solved it by ensuring that sudo was put before docker during login.

aws ecr get-login-password --region <your-region>| sudo docker login --username AWS --password-stdin <userID>.dkr.ecr.<your-region>.amazonaws.com

You are a life saver. Just missed sudo. Just reminded me that the push command I copied from aws doesnt know that I have to run all my docker commands as sudo.

1 Like