【问题标题】:I cant push Docker image to AWS ecr我无法将 Docker 映像推送到 AWS ecr
【发布时间】:2021-02-05 02:13:03
【问题描述】:

我正在尝试将 Docker 映像从构建到 AWS ECR 的 Dockerfile 推送,但是当运行此命令时:

$ aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin 477629773586.dkr.ecr.eu-west-1.amazonaws.com 

出现错误:

调用时发生错误 (AccessDeniedException) GetAuthorizationToken 操作: 用户: arn:aws:iam::477629773586:user/albertosanmartin 无权 在资源上执行:ecr:GetAuthorizationToken:* 错误:不能 从非 TTY 设备执行交互式登录

我已经安装并配置了这些文件:

~/.aws/配置:

[default]
...
[mrthink]
region = eu-west-1
output = json

~/.aws/凭据

[default]
...
[mrthink]
aws_access_key_id = ****
aws_secret_access_key = ****

似乎命令 api get other user "albertosanmartin"

有人可以帮帮我吗? 提前致谢。

【问题讨论】:

    标签: amazon-web-services docker amazon-ecs amazon-ecr


    【解决方案1】:

    如果您在~/.aws/credentials 中的mrthink 配置文件名称下配置了凭据,则需要将--profile 参数传递给aws cli

    $ aws  --profile mrthink ecr get-login-password \
    --region eu-west-1 |\
    docker login --username AWS \
    --password-stdin 477629773586.dkr.ecr.eu-west-1.amazonaws.com 
    

    用户arn:aws:iam::477629773586:user/albertosanmartin 无权访问ECR

    您可以通过sts get-caller-identity 电话仔细检查您的凭据,如果它们是您想要使用的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-23
      • 2020-02-13
      • 1970-01-01
      • 2018-06-17
      • 1970-01-01
      • 2019-02-06
      相关资源
      最近更新 更多