在Teamcity中运行docker-compose的问题

时间:2018-08-22 01:59:50

标签: docker asp.net-core docker-compose teamcity

我的Teamcity服务器已部署在docker中。

我正在尝试使用 docker-compose 命令构建 asp.net核心项目。 这是docker-compose.yml的代码:

version: '3.4'

services:
  fooservice:
    image: foo/foo.api:latest
    restart: always
    build:
      context: .
      dockerfile: MyProject/Dockerfile

但是,我遇到了错误

Step 1/1: Docker Compose
[01:55:10][Step 1/1] Unable to find build runner 'DockerCompose'
[01:55:10][Step 1/1] Unable to find build runner 'DockerCompose'
[01:55:10][Step 1/1] Step Docker Compose failed with unexpected error

更新

  

如果我切换到命令行构建器(docker-compose -f docker-compose.yml up --no-start --build),则会发生以下错误:

[07:20:31]Step 1/1: Command Line
[07:20:31][Step 1/1] Unable to find build runner 'simpleRunner'
[07:20:31][Step 1/1] Unable to find build runner 'simpleRunner'
[07:20:31][Step 1/1] Step Command Line failed with unexpected error

1 个答案:

答案 0 :(得分:1)

您已在teamcity-agent上构建并安装DockerCompose的Dockerfile。您还需要确保已安装或可访问Docker。

dockerhub page for teamcity-agent中所述,您可以通过安装docker socket来授予teamcity代理容器对主机docker守护程序的访问权限

...
-v /var/run/docker.sock:/var/run/docker.sock
...