Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 15970

How can I use cache image when using bootBuildImage on spring boot project?

$
0
0

I am considering introducing buildpacks to a project that uses Spring Boot.

Most of the operations seem to work without any issues. However, one problem is that the build time has increased.Currently, I am running the bootBuildImage task through GitHub Actions. To improve the build time, I applied launchCache and buildCache settings, but I didn't see a significant effect.

After checking the buildpacks documentation, I noticed that there is a cache-image option available: https://buildpacks.io/docs/for-app-developers/how-to/build-inputs/use-cache-image/I think this could be a good solution, but I am wondering if there is a way to set the cache-image option in the Spring Boot Gradle plugin.

Could someone please guide me on how to configure the cache-image option in the Spring Boot Gradle plugin when using buildpacks? Any help or suggestions would be greatly appreciated.

Thank you in advance!

Below is my trial

    bootBuildImage {        builder = "paketobuildpacks/builder-jammy-base:0.4.292"        buildpacks.set(            listOf("gcr.io/paketo-buildpacks/amazon-corretto:8.4.2","urn:cnb:builder:paketo-buildpacks/java"            )        )        environment.set(            mapOf("BP_DATADOG_ENABLED" to "true"            )        )        buildCache {            bind {                source.set("/tmp/cache-${rootProject.name}.build")            }        }        launchCache {            bind {                source.set("/tmp/cache-${rootProject.name}.launch")            }        }    }

Viewing all articles
Browse latest Browse all 15970

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>