首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >docker-compose in fabric8 8的docker-maven-plugin不工作

docker-compose in fabric8 8的docker-maven-plugin不工作
EN

Stack Overflow用户
提问于 2020-08-17 04:00:14
回答 1查看 835关注 0票数 0

我正在尝试让docker-maven-plugin在集成测试之前在docker容器中运行redisPostgreSQL 11实例。以下是我在pom.xml文件中的设置:

代码语言:javascript
复制
    <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>${docker-maven.version}</version>
        <configuration>
            <verbose>true</verbose>
            <images>
                <image>
                    <alias>docker-dbs</alias>
                    <external>
                        <type>compose</type>
                        <composeFile>docker-compose-test.yml</composeFile>
                    </external>
                    <run>
                        <wait>
                            <time>5000</time>
                            <log>Docker databases are ready to accept connections</log>
                        </wait>
                    </run>
                </image>
            </images>
        </configuration>
        <executions>
            <execution>
                <id>start-docker-dbs</id>
                <phase>pre-integration-test</phase>
                <goals>
                    <goal>build</goal>
                    <goal>start</goal>
                </goals>
            </execution>
            <execution>
                <id>stop-docker-dbs</id>
                <phase>post-integration-test</phase>
                <goals>
                    <goal>stop</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

我正在尝试运行指定的docker-compose-test.yml文件中定义的服务,该文件包含以下内容:

代码语言:javascript
复制
version: "3.8"
alias: docker-dbs
services:

  redis:
    image: "redis:alpine"
    command: redis-server
    environment:
      - REDIS_REPLICATION_MODE=master
    ports:
      - "5378:6379"

  postgres:
    image: "postgres:11"
    restart: always
    environment:
      POSTGRES_USER: admin
      POSTGRES_PASSWORD: admin
      POSTGRES_DB: topfind-accounts-test-db
    ports:
      - "4431:5432"

我知道这个文件是正确的,因为我试图手动运行它,但是当我需要它时,我无法让maven为我运行它。有什么建议可以解释为什么这个方法不起作用吗?

EN

回答 1

Stack Overflow用户

发布于 2020-08-21 20:31:07

看起来仍然不支持composer文件的3.x版。

我遇到了类似的问题,并看到了错误消息:Execution start of goal io.fabric8:docker-maven-plugin:0.33.0:stop failed: Only version 2.x of the docker-compose format is supported for src/main/docker/docker-compose.yml

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63441418

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档