Environment:
- Jib version: jib-core 0.28.1
- Build tool: Gradle 8, Gradle 9, Gradle 9.5.1
- OS: MacOS Tahoe 26.3.1
Description of the issue:
With a scratch base image, Jib still creates the base image layers cache directory, which stays empty since scratch has no layers to cache. BuildContext.Builder.build() calls Cache.withDirectory(...) unconditionally, which eagerly creates the directory.
Expected behavior:
No base image layers cache directory is created for a scratch base image.
Steps to reproduce:
- Set base image to scratch.
- Run a build.
- The base image layers cache directory is created but empty.
Additional Information:
I've prepared a fix for this issue and would be happy to open a PR if you'd accept it. Thanks!
Environment:
Description of the issue:
With a scratch base image, Jib still creates the base image layers cache directory, which stays empty since scratch has no layers to cache. BuildContext.Builder.build() calls Cache.withDirectory(...) unconditionally, which eagerly creates the directory.
Expected behavior:
No base image layers cache directory is created for a scratch base image.
Steps to reproduce:
Additional Information:
I've prepared a fix for this issue and would be happy to open a PR if you'd accept it. Thanks!