Alex Dai Playground

[AWS] CLI docker login

| Comments

  • 下載 AWS CLI
  • 新增 IAM 使用者 & 賦予權限 AmazonEC2ContainerRegistryFullAccess & AmazonEC2ContainerServiceFullAccess
  • 記下 AWS Access Key ID & AWS Secret Access Key
  • 設定
    > aws configure
    AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
    AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
    Default region name [None]: us-west-2
    Default output format [None]: ENTER
    
    
    


    • 登入
      aws ecr get-login --region us-east-1
      將產生的 docker login -u AWS -p xxxxx..... 指令 貼到 console 執行

    • tag images
      docker tag myImage:latest xxx.dkr.ecr.us-east-1.amazonaws.com/xxx:latest

    • push images
      docker push xxx.dkr.ecr.us-east-1.amazonaws.com/xxx:latest

    • 發生 no basic auth credentials (Docker for Windows)?
      打開 ~/.docker/config.json 並刪除 "credsStore": "wincred" (auth token 才會寫入 config.json)
      重新執行 aws ecr get-login --region us-east-1 步驟

    • http://stackoverflow.com/a/38774620

Comments

comments powered by Disqus