only enable --cache-dir to cache base images, do not use other cache options.
Actual behavior Kaniko will push cache layers to remote registry when I set --cache=true. From my testing, this behavior doesn't help reducing build time. Kaniko need to push/pull cache layers and uncompress them, which will cost lot of time. Compared to Run steps in Dockerfile, using cache layers doesn't save time. Pushing cache layers to remote registry also has additional cost on network traffic and disk space.
Expected behavior I want to only enable --cache-dir to cache base images, do not use other cache options.
To Reproduce
- gcr.io/kaniko-project/executor:v1.20.0-debug
- Run command
/kaniko/executor --cache=true --cache-dir=/kaniko/cache --snapshot-mode=redo --cleanup --context=. --dockerfile=Dockerfile --destination=harbor.demo.com/test/foo-project:20240130105439
Hi, For me the --cache option reduces build time significantly.
However I agree that we should be able to enable base image caching separately from layers caching.