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

后端 未结 30 2070
旧巷少年郎
旧巷少年郎 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:49

    If it helps anyone...

    My problem was that I had to use the --profile option in order to authenticate with the proper profile from the credentials file.

    Next, I had ommitted the --region [region_name] command, which also gave the "no basic auth credentials" error.

    The solution for me was changing my command from this:

    aws ecr get-login

    To this:

    aws --profile [profile_name] ecr get-login --region [region_name]

    Example:

    aws --profile foo ecr get-login --region us-east-1

    Hope that helps someone!

提交回复
热议问题