Skip to content

Instantly share code, notes, and snippets.

@iainporter
Created August 28, 2020 11:06
Show Gist options
  • Save iainporter/8a0070cd47f07ae11ed81838ec42ba73 to your computer and use it in GitHub Desktop.
Save iainporter/8a0070cd47f07ae11ed81838ec42ba73 to your computer and use it in GitHub Desktop.
Native profile for building native image in qaurkus
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M3</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>
${project.build.directory}/${project.build.finalName}-runner
</native.image.path>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<!-- Create new docker image -->
<execution>
<id>docker-build-service</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>docker</executable>
<workingDirectory>${project.basedir}</workingDirectory>
<arguments>
<argument>build</argument>
<argument>-f</argument>
<!-- build the image with the native executable
use mvn install -Pnative to build-->
<argument>Dockerfile.native</argument>
<argument>-t</argument>
<argument>porterhead/sms-service</argument>
<argument>.</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment