I want to build an image of one of my microservice using maven jib plugin and as I know docker image can be created in multilayer architecture. I was doing this in Dockerfile manually. But not sure how this can be achieved with maven jib plugin Following is plugin with configuration that I am using to build image.
Please guide me to create multilayer image.
<profile>
<id>jib</id>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<from>
<image>gcr.io/test/java:11</image>
</from>
<to>
<image>aa/${project.artifactId}</image>
<tags>
<tag>latest</tag>
<!--suppress MavenModelInspection -->
<tag>Test</tag>
</tags>
</to>
<container>
<ports>
<port>7575</port>
<port>9000</port>
<port>9001</port>
<port>9002</port>
</ports>
<jvmFlags>
<jvmFlag>-Duser.timezone=GMT</jvmFlag>
<jvmFlag>-Dfile.encoding=utf-8</jvmFlag>
<jvmFlag>-XX:MaxRAMFraction=2</jvmFlag>
<jvmFlag>-XX:+UseG1GC</jvmFlag>
<jvmFlag>-XX:+UseStringDeduplication</jvmFlag>
</jvmFlags>
<volumes>
<volume>/tmp</volume>
</volumes>
</container>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>dockerBuild</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>