Tag: fabric8

在maven中同时运行docker容器和spring启动应用程序是可能的吗?

我有一个连接到MongoDB实例的Spring Boot应用程序。 对于MongoDB实例,我使用docker,特别是使用fabric8中的maven docker插件。 我有这样的configuration: <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.21.0</version> <configuration> <logDate>default</logDate> <autoPull>true</autoPull> <images> <image> <name>mongo:3.0.15</name> <run> <ports> <port>27018:27017</port> </ports> <wait> <log>(?s)database system is ready to accept connections.*database system is ready to accept connections</log> <time>40000</time> </wait> <log> <prefix>mongo-container</prefix> <color>yellow</color> </log> </run> </image> </images> </configuration> </plugin> 它运行完美,如果我运行mvndocker:启动和在其他terminalmvn春季启动:运行。 我想知道的是,如果可以创build一些mavenconfiguration来运行一个像mvn docker这样的命令:start spring-boot:run。 谢谢!

Maven集成testing2个模块

我有一个应用程序与2个模块: Web JSF(部署在Tomcat上的WAR) REST服务(部署在Wildfly上的WAR) 对于集成testing,我使用Maven插件: maven故障安全插件 fabric8 maven插件 我的testing源代码和资源位于两个应用程序src / integration-test / java中。 在集成testing阶段,fabric8构buildWildfly docker镜像,复制构build的articact(REST Services WAR),启动容器并运行testing。 它工作正常。 但是…我想configurationmaven以部署2个应用程序(Web JSF WAR工件和REST服务WAR),并从JSF WAR / src / integration-test / java运行集成testing。 使用fabric8插件很容易构build和运行Tomcat和Wildfly容器,但我无法find如何从不同的Maven模块部署2个不同的工件。 也许你有什么想法? 最好的问候,MJ。

Fabric8 docker maven插件不能用于多模块项目上的compose.yml

我尝试使用Fabric8 docker-maven-plugin,但是我成功地为各个模块configuration插件并运行docker:build docker:start docker docker:build docker:start maven目标而不使用docker-compose.yml,但是我需要外部化端口并链接不同的模块,因此我打算使用docker-compose.yml。 以下是我的项目结构。 –kp-parent | — docker-compose.yml — pom.xml | —- rest1 | | | — .maven-dockerignore | — pom.xml | — Dockerfile —- rest2 | | | — .maven-dockerignore | — pom.xml | — Dockerfile 这是我的configuration Dockerfile [除了不同的端口,rest1和rest2都使用相同的文件] FROM openjdk:8-jdk-alpine MAINTAINER 'Karthik Prasad' ARG IMAGE_VERSION ARG JAR_FILE ENV JAVA_OPTS="" […]

com.spotify.docker.client.DockerRequestException:请求错误:DELETE unix:// localhost:80 / v1.12 / containers / …:409

我正在开发一个Java应用程序,它使用Google Kubernetes在Apache Tomcat Docker Containers中部署Web工件。 我使用https://github.com/spotify/docker-client来执行Docker镜像和容器处理活动,并使用https://github.com/fabric8io/fabric8/tree/master/components/kubernetes-api Kubernetes相关的function。 在这个应用程序中,我添加了一个function,使用户能够移除用户部署的Web工件。 删除I时, 删除我用来生成所需数量的Pod复制副本的Kubernetes复制控制器 分别删除副本窗格(因为在Java API的相应方法中删除复制控制器时,不会自动删除窗格) 删除掉相应的服务创build 删除对应于已删除的窗格的Docker容器 最后,删除用于部署的Docker镜像 以下代码显示了已执行的删除function: public boolean remove(String tenant, String appName) throws WebArtifactHandlerException { String componentName = generateKubernetesComponentName(tenant, appName); final int singleImageIndex = 0; try { if (replicationControllerHandler.getReplicationController(componentName) != null) { String dockerImage = replicationControllerHandler.getReplicationController(componentName).getSpec() .getTemplate().getSpec().getContainers().get(singleImageIndex).getImage(); List<String> containerIds = containerHandler.getRunningContainerIdsByImage(dockerImage); replicationControllerHandler.deleteReplicationController(componentName); podHandler.deleteReplicaPods(tenant, appName); serviceHandler.deleteService(componentName); […]