问题描述
我有以下buildspec.yml:
I have the following buildspec.yml:
version: 0.2
phases:
install:
commands:
- curl -L -o sbt-0.13.6.deb http://dl.bintray.com/sbt/debian/sbt-0.13.6.deb && \
- dpkg -i sbt-0.13.6.deb && \
- rm sbt-0.13.6.deb && \
- apt-get update && \
- apt-get install sbt && \
pre_build:
commands:
- echo Entered the pre_build phase...
- docker login -u user -p pass
build:
commands:
- echo Build started on `date`
- sbt test
- echo test completed on `date`
- sbt docker:publishLocal
- docker tag image repo
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker image...
- docker push repo
cache:
paths:
- $HOME/.ivy2/cache
- $HOME/.sbt
并失败
在控制台中
.据我在文档中提供的示例中所见,应该已经给出了docker.
in the console. As far as I see in the examples provided in the doc, docker should be already given.
如何避免这种情况?谢谢
How can I avoid this?Thanks
推荐答案
在CodeBuild项目中,选择特权"标志以在构建容器中启用Docker.如果您使用的是CodeBuild托管映像,则只需选择此标志.如果您使用的是自定义映像,请确保按照 https://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker-custom-image.html
On your CodeBuild project select the "privileged" flag to enable Docker in your build container. If you are using a CodeBuild managed image, then selecting this flag is all that's needed. If you are using a custom image then ensure the Docker is started as explained in https://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker-custom-image.html
这篇关于AWS CodeBuild-泊坞窗:找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!