Tag: maven docker plugin

使用Maven的setting.xml将构buildparameter passing到fabric8io / docker-maven-plugin

我们使用fabric8io / docker-maven-plugin在我们的应用程序中构builddocker。 因为我们坐在企业防火墙后面,所以我们需要为我们的构build设置一个代理。 作为我们的docker文件的一部分,我们定义了ARG HTTPS_PROXY。 现在要构build我们的docker,我们需要使用mvn命令行来传递代理参数: mvn clean install -Ddocker.buildArg.http_proxy=<proxy> -Ddocker.buildArg.https_proxy=<proxy> 我正在寻找一种方法来在maven设置xml中设置这个configuration。 使其更容易。 任何build议将不胜感激

如何设置AWS ECS + dockerfile-maven-plugin?

我试图设置我的项目的pom.xml和Maven的settings.xml来自动生成Docker镜像并将其推送到我的AWS ECS私有Docker存储库。 在我的pom.xml ,我添加了dockerfile-maven-plugin,并将其configuration如下: <plugin> <groupId>com.spotify</groupId> <artifactId>dockerfile-maven-plugin</artifactId> <version>1.3.6</version> <executions> <execution> <id>default</id> <goals> <goal>build</goal> <goal>push</goal> </goals> </execution> </executions> <configuration> <finalName>myproject/server</finalName> <repository>137037344249.dkr.ecr.us-east-2.amazonaws.com/myproject/server</repository> <tag>${docker.image.tag}</tag> <serverId>ecs-docker</serverId> <useMavenSettingsForAuth>true</useMavenSettingsForAuth> <buildArgs> <VERSION>${project.version}</VERSION> <BUILD_NUMBER>${buildNumber}</BUILD_NUMBER> <WAR_FILE>${project.build.finalName}.war</WAR_FILE> </buildArgs> </configuration> </plugin> 根据dockerfile-maven-plugin提供的说明,我需要为ECS服务器身份validation添加configuration,但是我不知道需要提供什么用户名/密码。 我怀疑这是我的AWSlogin用户/通行证。 <servers> <server> <id>ecs-docker</id> <username>where_to_get_this</username> <password>where_to_get_this</password> </server> </servers> 此外,任何build议,以自动化此Docker图像生成/推送到我的回购更好的方式,是值得欢迎的。

docker-maven-plugin与MongoDB映像在启动时挂起

我试图用docker-maven-pluginconfigurationMongoDB镜像。 这是我的configuration: <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.21.0</version> <configuration> <showLogs>true</showLogs> <images> <image> <name>mongo:3.0.15</name> <alias>mongo</alias> <run> <ports> <port>27017:27017</port> </ports> <wait> <log>waiting for connections on port</log> <time>60000</time> </wait> </run> </image> </images> </configuration> <executions> <execution> <id>prepare-containers</id> <phase>pre-integration-test</phase> <goals> <goal>start</goal> </goals> </execution> <execution> <id>remove-containers</id> <phase>post-integration-test</phase> <goals> <goal>stop</goal> </goals> </execution> </executions> </plugin> 当我调用 mvn docker:start -Dfile.encoding = UTF-8 该调用挂起以下输出: D:\Projects\decisionwanted\domain>mvn docker:start -Dfile.encoding=UTF-8 […]

Kafka Docker和从9092到9093的端口转发

我已经通过maven docker插件https://dmp.fabric8.io/configuration了Kafka + ZooKeeper: <image> <name>wurstmeister/zookeeper:latest</name> <alias>zookeeper</alias> <run> <ports> <port>2181:2181</port> </ports> </run> </image> <image> <name>wurstmeister/kafka:1.0.0</name> <alias>kafka</alias> <run> <ports> <port>9092:9092</port> </ports> <links> <link>zookeeper:zookeeper</link> </links> <env> <KAFKA_ADVERTISED_HOST_NAME>127.0.0.1</KAFKA_ADVERTISED_HOST_NAME> <KAFKA_ZOOKEEPER_CONNECT>zookeeper:2181</KAFKA_ZOOKEEPER_CONNECT> </env> </run> </image> 在这个configuration上,一切工作正常。 现在我需要将Kafka端口(主机系统的转发端口)从9092更改为9093 。 在我的Spring Boot应用程序的application.properties中,我添加了以下行: spring.kafka.bootstrap-servers=127.0.0.1:9093 还将Kafka图像的configuration更改为: <image> <name>wurstmeister/kafka:1.0.0</name> <alias>kafka</alias> <run> <ports> <port>9093:9092</port> </ports> <links> <link>zookeeper:zookeeper</link> </links> <env> <KAFKA_ADVERTISED_HOST_NAME>127.0.0.1</KAFKA_ADVERTISED_HOST_NAME> <KAFKA_ZOOKEEPER_CONNECT>zookeeper:2181</KAFKA_ZOOKEEPER_CONNECT> </env> </run> </image> 并面临以下错误: 2017-11-22 18:18:16.453 […]

Kafka Docker,docker-maven-plugin,Spring Boot

我试图通过Docker Maven Plugin启动Kafka https://github.com/fabric8io/docker-maven-plugin 我使用以下Maven图像: https : //hub.docker.com/r/wurstmeister/kafka/ 这是我的Mavenconfiguration: <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <version>${docker-maven-plugin.version}</version> <configuration> <showLogs>true</showLogs> <images> <image> <name>wurstmeister/kafka:1.0.0</name> <alias>kafka</alias> <run> <ports> <port>9092:9092</port> </ports> </run> </image> </images> </configuration> <executions> <execution> <id>prepare-containers</id> <phase>pre-integration-test</phase> <goals> <goal>start</goal> </goals> </execution> <execution> <id>remove-containers</id> <phase>post-integration-test</phase> <goals> <goal>stop</goal> </goals> </execution> </executions> </plugin> mvn docker:start -Dfile.encoding=UTF-8的输出mvn docker:start -Dfile.encoding=UTF-8命令: [INFO] Scanning for projects… [INFO] [INFO] […]

澄清Mavenconfiguration文件和阶段

在我的maven项目中,我有多个mavenconfiguration文件。 在每个configuration文件中,我有docker-maven-plugin和maven-failsafe-plugin 。 这是我如何约束目标和阶段。 泊坞窗- Maven的插件 <phase>pre-integration-test</phase> <goals> <goal>start</goal> </goals> <phase>post-integration-test</phase> <goals> <goal>stop</goal> <goal>remove</goal> </goals> Maven的故障保护,插件 <phase>integration-test</phase> <goals> <goal>integration-test</goal> </goals> <phase>verify</phase> <goals> <goal>verify</goal> </goals> 我有每个数据库types的configuration文件(即MySQL,Postgres等)。 我想要做的是在docker上运行我的集成testing与每个数据库types。 我的问题是,我可以运行mvn多个configuration文件(即mvn clean install -P local-postgres,local-mysql ),以便每个configuration文件一个接一个地执行? 我的要求是不要同时有2个docker集装箱。 我所观察到的是,所有configuration文件的pre-integration-test阶段都是先运行的,并且以The name "/apim-postgres" is already in use by container xxxxx失败。 当多个configuration文件被给出时,maven阶段应该如何工作? 有没有办法让我的要求得到满足?