Skip to content

Instantly share code, notes, and snippets.

@abelaska
Last active October 21, 2021 14:18
Show Gist options
  • Save abelaska/1e8bbd7c42f65021c68b93627e261878 to your computer and use it in GitHub Desktop.
Save abelaska/1e8bbd7c42f65021c68b93627e261878 to your computer and use it in GitHub Desktop.
Adoptopenjdk 11 openj9
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<from>
<image>adoptopenjdk/openjdk11-openj9:alpine-slim</image>
</from>
<extraDirectories>
<paths>
<path>
<from>target/classCache</from>
<into>/app-cache</into>
</path>
</paths>
</extraDirectories>
<container>
<jvmFlags>
<!-- <jvmFlag>-XshowSettings:vm</jvmFlag>-->
<jvmFlag>-Djava.security.egd=file:/dev/urandom</jvmFlag>
<jvmFlag>--add-opens=java.base/sun.nio.ch=ALL-UNNAMED</jvmFlag>
<jvmFlag>-Xshareclasses:name=${project.artifactId},cacheDir=/app-cache,readonly</jvmFlag>
<!-- https://developers.redhat.com/blog/2017/04/04/openjdk-and-containers/ -->
<jvmFlag>-Xss256k</jvmFlag>
<jvmFlag>-Xms32m</jvmFlag>
<jvmFlag>-XX:MinHeapFreeRatio=10</jvmFlag>
<jvmFlag>-XX:MaxHeapFreeRatio=20</jvmFlag>
<jvmFlag>-XX:GCTimeRatio=4</jvmFlag>
<jvmFlag>-XX:AdaptiveSizePolicyWeight=90</jvmFlag>
</jvmFlags>
</container>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xshareclasses:name=${project.artifactId},cacheDir=target/classCache,enableBCI -Xscmx80M
</argLine>
</configuration>
</plugin>
</plugins>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment