Skip to content

Add support for image-based build caches - #50899

Merged
snicoll merged 2 commits into
spring-projects:mainfrom
TYsewyn:cache-image-support
Jul 27, 2026
Merged

Add support for image-based build caches#50899
snicoll merged 2 commits into
spring-projects:mainfrom
TYsewyn:cache-image-support

Conversation

@TYsewyn

@TYsewyn TYsewyn commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Added a new image cache option that uses the lifecycle's -cache-image argument for the creator, analyzer, restorer and exporter phases, so the build cache can be stored in an image and shared between hosts via an image registry.

Exposed the option in the Maven (<buildCache><image>) and Gradle (buildCache { image { } }) plugins.

Reject image caches configured for the launch cache, which the lifecycle does not support.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 30, 2026
@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 27, 2026
@snicoll snicoll self-assigned this Jul 27, 2026
@snicoll snicoll added this to the 4.2.x milestone Jul 27, 2026
@snicoll
snicoll force-pushed the cache-image-support branch from 5dafdb4 to 814fd5a Compare July 27, 2026 16:20
Added a new image cache option that uses the lifecycle's
`-cache-image` argument for the creator, analyzer, restorer and
exporter phases, so the build cache can be stored in an image and
shared between hosts via an image registry.

Exposed the option in the Maven (`<buildCache><image>`) and Gradle
(`buildCache { image { } }`) plugins.

Reject image caches configured for the launch cache, which the
lifecycle does not support.

See spring-projectsgh-50899

Signed-off-by: Tim Ysewyn <Tim.Ysewyn@me.com>
snicoll pushed a commit to TYsewyn/spring-boot that referenced this pull request Jul 27, 2026
Added a new image cache option that uses the lifecycle's
`-cache-image` argument for the creator, analyzer, restorer and
exporter phases, so the build cache can be stored in an image and
shared between hosts via an image registry.

Exposed the option in the Maven (`<buildCache><image>`) and Gradle
(`buildCache { image { } }`) plugins.

Reject image caches configured for the launch cache, which the
lifecycle does not support.

See spring-projectsgh-50899

Signed-off-by: Tim Ysewyn <Tim.Ysewyn@me.com>
snicoll added a commit to TYsewyn/spring-boot that referenced this pull request Jul 27, 2026
@snicoll
snicoll force-pushed the cache-image-support branch from 814fd5a to 5bd3e64 Compare July 27, 2026 16:22
@snicoll
snicoll merged commit ccf6767 into spring-projects:main Jul 27, 2026
3 of 4 checks passed
@snicoll snicoll modified the milestones: 4.2.x, 4.2.0-M1 Jul 27, 2026
@snicoll

snicoll commented Jul 27, 2026

Copy link
Copy Markdown
Member

Good stuff @TYsewyn, thanks! To make the difference between the new cache, I've changed the abstraction a bit with LocalCache (bind, volume) and ImageCache. This prevents settings the wrong type were it is not supported. Let me know if I've missed something in doing so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants