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

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

    1. Make sure you have created the ECR registry first.
      Then as per the ECR Push Command Instructions, cut and paste the following commands
    2. Execute the docker login command (eval on Mac/Linux skips the cut-and-paste)
      eval $(aws ecr get-login --region us-east-1)
      add --profile if you use multiple AWS Accounts
      eval $(aws ecr get-login --region us-east-1 --profile your-profile)
    3. docker build -t image-name .
    4. docker tag image-name:latest ############.dkr.ecr.us-east-1.amazonaws.com/image-name:latest
    5. docker push ############.dkr.ecr.us-east-1.amazonaws.com/image-name:latest

    In case of error, make sure you run all the commands again! The credentials you get using aws ecr get-login are temporary and will expire.

提交回复
热议问题