我在 CodeBuild 构建过程的 BUILD 阶段收到以下错误:
“执行命令时出错:docker build -t ...”原因:退出状态1
我有一个设置了 ecr 权限的代码构建服务角色,aws ecr 登录阶段已经成功,我的 buildspec.yml 非常简单 - 几乎只是标准模板。运行时是 Amazon 管理的 ubuntu 映像,标准。
是否有任何原因为什么 Docker 构建可能会失败以及任何人建议进行故障排除?
谢谢
完整的 buildspec.yml 文件:
version: 0.2
phases:
pre_build:
commands:
- echo Logging in to Amazon ECR...
- $(aws ecr get-login --no-include-email --region eu-west-1)
build:
commands:
- echo Building the Docker image...
- docker build -t maxmind:latest .
- docker tag maxmind:latest 381475286792.dkr.ecr.eu-west-1.amazonaws.com/maxmind:latest
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker …Run Code Online (Sandbox Code Playgroud)