Skip to content

Commit

Permalink
Add jib-maven-plugin to pluginManagement in exomiser pom.xml
Browse files Browse the repository at this point in the history
Add new docker:web-build maven profile in exomiser-web pom.xml
Ensure same distroless image is used in cli and web
  • Loading branch information
julesjacobsen committed Feb 28, 2023
1 parent db8a723 commit 82ddeac
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 47 deletions.
10 changes: 1 addition & 9 deletions exomiser-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,13 @@
<profile>
<id>docker:bash</id>
<properties>
<docker.base.image>eclipse-temurin:17.0.6_10-jre
</docker.base.image>
<docker.base.image>eclipse-temurin:17.0.6_10-jre</docker.base.image>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>build-docker-image</id>
Expand Down Expand Up @@ -273,17 +271,11 @@
</profile>
<profile>
<id>docker:distroless</id>
<properties>
<docker.base.image>
gcr.io/distroless/java17-debian11@sha256:d5a7bb2b1bcd09d9b7ba7f7b13df39cbb2ab2ff73a0ab834a5769e59229af2f8
</docker.base.image>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>build-docker-image</id>
Expand Down
93 changes: 56 additions & 37 deletions exomiser-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,43 +140,62 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>buildTar</goal>
</goals>
</execution>
</executions>
<configuration>
<from>
<image>${docker.base.image}</image>
<platforms>
<platform>
<architecture>amd64</architecture>
<os>linux</os>
</platform>
</platforms>
</from>
<to>
<image>${project.artifactId}:${project.parent.version}</image>
<tags>
<tag>${project.parent.version}</tag>
<tag>latest</tag>
</tags>
</to>
<container>
<volumes>
<volume>/exomiser-data</volume>
<volume>/exomiser</volume>
</volumes>
</container>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>docker:web-build</id>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<executions>
<execution>
<id>build-docker-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
<configuration>
<from>
<image>
${docker.base.image}
</image>
<platforms>
<platform>
<os>linux</os>
<architecture>arm64</architecture>
</platform>
<platform>
<os>linux</os>
<architecture>amd64</architecture>
</platform>
</platforms>
</from>
<to>
<image>
${docker.registry}/${docker.repository}/${project.artifactId}:${project.parent.version}
</image>
<tags>
<tag>latest</tag>
<tag>latest-distroless</tag>
<tag>${project.parent.version}-distroless</tag>
</tags>
</to>
<container>
<volumes>
<volume>/exomiser-data</volume>
<volume>/exomiser</volume>
<volume>/results</volume>
</volumes>
</container>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
11 changes: 10 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<protobuf.version>3.21.12</protobuf.version>
<spring-boot.version>2.7.7</spring-boot.version>
<docker.base.image>
gcr.io/distroless/java17@sha256:ab37242e81cbc031b2600eef4440fe87055a05c14b40686df85078cc5086c98f
gcr.io/distroless/java17-debian11@sha256:d5a7bb2b1bcd09d9b7ba7f7b13df39cbb2ab2ff73a0ab834a5769e59229af2f8
</docker.base.image>
<docker.registry>docker.io</docker.registry>
<docker.repository>exomiser</docker.repository>
Expand Down Expand Up @@ -223,6 +223,15 @@
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.3.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<!-- n.b. the wrapper plugin is completely broken and will only work on Maven 3.7.0+ -->
Expand Down

0 comments on commit 82ddeac

Please sign in to comment.