【以下的问题经过翻译处理】 我是AWS CodeBuild的新手,在尝试创建一个构建容器镜像的项目时遇到了困难,该容器镜像会被推送到ECR然后在Fargate上运行。
我使用了这个教程中的示例buildspec:https://docs.aws.amazon.com/codepipeline/latest/userguide/ecs-cd-pipeline.html
由于某种原因,在PRE_BUILD期间构建失败,看起来是codebuild没有识别到AWS cli命令?
以下是CloudWatch的输出:
[Container] 2022/01/22 20:03:29 Running command echo Logging in to Amazon ECR...
Logging in to Amazon ECR...
[Container] 2022/01/22 20:03:29 Running command aws --version
/codebuild/output/tmp/script.sh: 4: aws: not found
[Container] 2022/01/22 20:03:29 Command did not exit successfully aws --version exit status 127
[Container] 2022/01/22 20:03:29 Phase complete: PRE_BUILD State: FAILED
[Container] 2022/01/22 20:03:29 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: aws --version. Reason: exit status 127
我非常感谢可以得到的所有帮助,在此提前致谢!