【发布时间】:2019-03-12 15:38:33
【问题描述】:
我正在尝试在 AWS 代码构建中构建一个 docker 容器,作为将容器部署到 ECR 的一种方式,但我收到此错误。
Error while executing command: $(aws ecr get-login --region ap-southeast-1). Reason: exit status 255
此命令在 buildspec.yml 文件上运行,使用 aws/codebuild/ubuntu-base:14.04 如果您想要构建 Docker 映像或希望您的构建获得提升的权限,请启用此标志。
日志文件如下:
[Container] 2018/10/11 00:52:49 Running command $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email)
An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:sts::502776083946:assumed-role/code-build-timesheet/AWSCodeBuild-f1d205b1-b03f-4727-a4d7-a02118021eec is not authorized to perform: ecr:GetAuthorizationToken on resource: *
[Container] 2018/10/11 00:52:52 Command did not exit successfully $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email) exit status 255
[Container] 2018/10/11 00:52:52 Phase complete: INSTALL Success: false
[Container] 2018/10/11 00:52:52 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email). Reason: exit status 255
【问题讨论】:
-
即使
Error while executing command: $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email). Reason: exit status 255也不起作用
标签: amazon-ecs aws-codebuild aws-ecr