I want to achieve the following: Packaging my Spring-Boot app into a Dockerimage where i can call a npx command in order to call a 3rd Party Node Library which i need in my App.
My Pom looks like this:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-image</goal>
</goals>
</execution>
</executions>
<configuration>
<image>
<name>my-app</name>
<buildpacks>
<buildpack>gcr.io/paketo-buildpacks/nodejs</buildpack>
<buildpack>gcr.io/paketo-buildpacks/java</buildpack>
</buildpacks>
</image>
</configuration>
</plugin>
</plugins>
</build>
Now with mvn package the plugin will be executed, but first: it will fail with an error:
Invalid response received when loading image "pack.local/builder/ayvwrfbvbm:latest"
However if i start the whole thing via pack the Image gets created
pack build my-app --builder paketobuildpacks/builder:base --buildpack paketo-buildpacks/nodejs --buildpack paketo-buildpacks/java
But in the created image i can not call node, nor npm nor npx, since it seems these layers are not added there.
If i then add a package.json and a server.js to my App-Root it seems that the npm-install layer is added but still i can not call node nor npm nor npx from within my container.
Please someone can show me a way how to create an image that runs a spring-boot app which then can call a 3rd party npm cli via
Runtime.getRuntime().exec("npx my3rdParty-cli");