首页 > 解决方案 > 在集成测试用例中使用 Nexus 中存在的 docker 映像

问题描述

我们在我们的应用程序中使用 PostGIS 数据库,并希望将其用于由 maven-failsafe-plugin 运行的集成测试用例。

我想从 Nexus 存储库中提取数据库映像并在预集成阶段建立数据库,以便可以在测试用例中使用它。我尝试使用 docker-maven-plugin

            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.35.0</version>
                <executions>
                    <execution>
                        <id>start-postgis</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>stop-postgis</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <images>
                        <image>
                            <alias>postgis</alias>
                            <name>postgis</name>
                            <run>
                                <ports>
                                    <port>7474</port>
                                </ports>
                                <wait>
                                    <log>Starting...</log>
                                    <time>20000</time>
                                </wait>
                            </run>
                        </image>
                    </images>
                </configuration>
            </plugin>

我有以下问题:在哪里指定要从 nexus 中提取的图像?我尝试研究 docker compose 但无法找到解决方案。

标签: dockermavendocker-composeintegration-testingdocker-maven-plugin

解决方案


推荐阅读