I am trying to insert a docker image into the Amazon ECR registry. I am using the Docker client Docker version 1.9.1, build a34a1d5. I use "aws ecr get-login --region us-east-1" to get credits for entering docker. Then I successfully logged in with these loans as follows:
docker login -u AWS -p XXXX -e none https://####.dkr.ecr.us-east-1.amazonaws.com WARNING: login credentials saved in /Users/ar/.docker/config.json Login Succeeded
But when I try to click on my image, I get the following error:
$ docker push
I made sure that the user aws had the correct permissions. I also made sure that the repository allowed this user to switch to it. Just to make sure this is not a problem, I set up the registry to give all users full access. Nothing changes the "no basic credentials" error. I do not know how to start debugging this, since all traffic is encrypted.
UPDATE
So I had a small moment by Homer Simpson when I understood the root cause of my problem. I have access to multiple AWS accounts. Although I used aws configure to set my credentials for the account in which I set up my repository, aws cli actually used the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables. Therefore, when I did aws ecr get-login, it returned the login of the wrong account. I did not notice that the account numbers were different until I returned to try some of the suggested answers. When I delete environment variables, everything works correctly. I assume that the motto of this story is that if you push this error, make sure that the repository you enter matches the tag that you applied to the image.
docker amazon-web-services aws-ecr
Alec Rooney Jan 09 '16 at 3:38 on 2016-01-09 03:38
source share