【问题标题】:AWS Build Project service docker-compose build command not workingAWS Build Project 服务 docker-compose build 命令不起作用
【发布时间】:2020-07-31 10:20:30
【问题描述】:

我想为我在 buildspect.yml 文件下面编写的内容构建 docker 映像并推送到 ECR 中,并使用 AWS 构建项目服务构建我的项目。 我的 buildspec.yml 文件如下:

version: 0.2
 


phases:
  install:
    runtime-versions:
      docker: 18
    commands: 
      - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://localhost:2375 --storage-driver=overlay2&
      - timeout 15 sh -c "until docker info; do echo .; sleep 1; done"
  pre_build:
   commands:
     - $(aws ecr get-login --no-include-email --region ${AWS_DEFAULT_REGION})
     - REPOSITORY_URI_SERVER=<accountnumber>.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${IMAGE_NAME}
  build:
    commands:
     - docker-compose build
  post_build:
    commands:
     - docker-compose push
    

当我使用 AWS 构建项目服务进行构建时,我会收到如下错误:

ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info
[Container] 2020/07/10 01:57:15 Command did not exit successfully timeout 15 sh -c "until docker info; do echo .; sleep 1; done" exit status 124
[Container] 2020/07/10 01:57:15 Phase complete: INSTALL State: FAILED
[Container] 2020/07/10 01:57:15 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: timeout 15 sh -c "until docker info; do echo .; sleep 1; done". Reason: exit status 124

【问题讨论】:

    标签: docker-compose aws-code-deploy aws-codepipeline aws-codebuild


    【解决方案1】:

    我尝试编写 buildspect.yml 文件如下 我在我的文件中添加了一个工件标签,这是我的项目构建的地方是一个商店。

    post_build: 命令: - 码头工人撰写推送 - printf '[{"name":"","imageUri":" imagedefinitions.json - 猫 imagedefinitions.json 文物: 文件:imagedefinitions.json

    我成功了。

    【讨论】:

      猜你喜欢
      • 2019-10-10
      • 1970-01-01
      • 2021-03-27
      • 1970-01-01
      • 2018-07-27
      • 2020-09-17
      • 2023-03-07
      • 1970-01-01
      • 2018-10-18
      相关资源
      最近更新 更多