AWS CodeBuild-泊坞窗:找不到

时间:2018-10-18 21:09:58

标签: amazon-web-services docker aws-codebuild

我有以下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

并失败

  

/codebuild/output/tmp/script.sh:4:/codebuild/output/tmp/script.sh:docker:未找到

在控制台中

。据我在文档中提供的示例中所看到的,应该已经给出了docker。

如何避免这种情况? 谢谢

1 个答案:

答案 0 :(得分:1)

在您的CodeBuild项目中,选择“特权”标志以在构建容器中启用Docker。如果您使用的是CodeBuild托管映像,则只需选择此标志。如果您使用的是自定义映像,请确保按照https://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker-custom-image.html

中的说明启动Docker。
相关问题