Can't push image to Amazon ECR - fails with “no basic auth credentials”

后端 未结 30 2119
旧巷少年郎
旧巷少年郎 2020-12-02 05:07

I\'m trying to push a docker image to an Amazon ECR registry. I\'m using docker client Docker version 1.9.1, build a34a1d5. I use aws ecr get-login --regi

30条回答
  •  悲哀的现实
    2020-12-02 05:37

    The docker command given by aws-cli is little off...

    When using docker login, docker will save a server:key pair either in your keychain or ~/.docker/config.json file

    If it saves the key under https://7272727.dkr.ecr.us-east-1.amazonaws.com the lookup for the key during push will fail because docker will be looking for a server named 7272727.dkr.ecr.us-east-1.amazonaws.com not https://7272727.dkr.ecr.us-east-1.amazonaws.com.

    Use the following command to login:

    eval $(aws ecr get-login --no-include-email --region us-east-1 --profile yourprofile | sed 's|https://||')
    

    Once you run the command you will get 'Login Succeeded' message and then you are good
    after that your push command should work

提交回复
热议问题