AWS Codepipeline

时间:2018-08-14 07:03:51

标签: amazon-web-services

我是AWS CodePipeline的新手。尝试使用Docker映像和ECS服务部署应用程序时,我的buildspec.yml文件出现以下错误:

[Container] 2018/08/14 06:20:36 Phase context status code: Message:
[Container] 2018/08/14 06:20:36 Entering phase INSTALL
[Container] 2018/08/14 06:20:36 Phase complete: INSTALL Success: true
[Container] 2018/08/14 06:20:36 Phase context status code: Message:
[Container] 2018/08/14 06:20:36 Entering phase PRE_BUILD
[Container] 2018/08/14 06:20:36 Running command echo Logging in to Amazon ECR... Logging in to Amazon ECR...
[Container] 2018/08/14 06:20:36 Running command aws --version aws-cli/1.15.41 Python/2.7.6 Linux/4.14.47-56.37.amzn1.x86_64 botocore/1.10.41
[Container] 2018/08/14 06:20:39 Running command $(aws ecr get-login --no-include-email --region us-east-xxx) WARNING! Using --password via the CLI is insecure. Use --password-stdin. Login Succeeded
[Container] 2018/08/14 06:20:40 Running command REPOSITORY_URI= xxxx.xxxx.ecr.us-east-xxx.amazonaws.com/python /codebuild/output/tmp/script.sh: 4: /codebuild/output/tmp/script.sh: xxxx.xxxx.ecr.us-east-xxx.amazonaws.com/python: not found
[Container] 2018/08/14 06:20:40 Command did not exit successfully REPOSITORY_URI= xxxx.xxxx.ecr.us-east-xxx.amazonaws.com/python exit status 127
[Container] 2018/08/14 06:20:40 Phase complete: PRE_BUILD Success: false
[Container] 2018/08/14 06:20:40 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: REPOSITORY_URI= xxxx.xxxx.ecr.us-east-xxx.amazonaws.com/python. Reason: exit status 127

感谢您的协助。如果有帮助,我可以附加我的buildspec.ymltaskdefinition.json文件。有推荐的方法吗?

1 个答案:

答案 0 :(得分:0)

似乎您在=xxxx.xxxx.ecr.us-east-xxx.amazonaws.com/python之间留有空格。

这意味着您正在将xxxx.xxxx.ecr.us-east-xxx.amazonaws.com/python评估为命令,并且由于此URI无效,因此它以状态代码127退出。

只需删除空格即可。