跨Maven概要文件的多个docker-maven插件

我目前的项目有3个Mavenconfiguration文件; runITs,postgres和mssql。 这些configuration文件结合起来,对两个数据库运行集成testingmvn -Ppostgres,runITsmvn -Pmssql,runITs

postgres和mssqlconfiguration文件都使用fabric8io docker-maven-plugin来启动相应的数据库容器。 由于每次只激活其中一个configuration文件,所以这一切都可以正常工作。

我现在正尝试使用同一个插件为Samba共享运行另一个docker容器,但由于此容器应该运行而不pipe数据库,我试过在runITsconfiguration文件中包含另一个副本:

 <configuration> <images> <image> <alias>samba</alias> <name>dperson/samba</name> <run> <env> <SMB>true</SMB> </env> <ports> <port>445:445</port> </ports> <wait> <log>STATUS=daemon 'smbd' finished starting up and ready to serve connections</log> <time>60000</time> </wait> <log> <prefix>SAMBA</prefix> <date>none</date> <file>${project.build.directory}/samba.log</file> </log> <volumes> <bind> <volume>${project.build.directory}/samba-data:/media</volume> </bind> </volumes> <cmd>samba.sh -u example1;badpass -s media;/media;no;no;no;example1 -p</cmd> </run> </image> </images> </configuration> <executions> <execution> <id>start-samba</id> <phase>pre-integration-test</phase> <goals> <goal>start</goal> </goals> </execution> <execution> <id>stop-samba</id> <phase>post-integration-test</phase> <goals> <goal>stop</goal> <goal>remove</goal> </goals> </execution> </executions> 

由于postgres中的第一个插件实例扫描并运行包含Samba的任何插件实例中的所有图像,然后runITs中的第二个插件实例尝试相同的结果:

 [INFO] --- docker-maven-plugin:0.19.1:start (start-postgres) @ bcam-services-test-acceptance --- [INFO] DOCKER> [dperson/samba] "samba": Start container 0cfdbb3961e6 [INFO] DOCKER> [dperson/samba] "samba": Waited on log out 'STATUS=daemon 'smbd' finished starting up and ready to serve connections' 1513 ms [INFO] [INFO] --- docker-maven-plugin:0.19.1:start (start-samba) @ bcam-services-test-acceptance --- [INFO] DOCKER> [dperson/samba] "samba": Start container 3495bfd0ed8d [ERROR] DOCKER> Error occurred during container startup, shutting down... [INFO] DOCKER> [dperson/samba] "samba": Stop and removed container 0cfdbb3961e6 after 0 ms [ERROR] DOCKER> I/O Error 

 [ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.19.1:start (start-samba) on project bcam-services-test-acceptance: I/O Error: Unable to start container id [3495bfd0ed8d]: driver failed programming external connectivity on endpoint cocky_aryabhata (7a190426a9169a7623e145384e64303bf10c3f97edddfaa1c624676c8fd05d58): Bind for 0.0.0.0:445 failed: port is already allocated (Internal Server Error: 500) -> [Help 1] 

不是在runIT中包含第二个插件,我可以在postgres和mssql之间复制它,但是显然重复并不理想。

我已经阅读了文档 ,但不知道如何分离这些实例,或者只有一份副本,但只能在适当的configuration文件中执行。