Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Clear Kaniko Cache on Build for Cloud Run

So we've updated the dockerfile, and would like to build w/o using the old Kaniko Cache, but want to replace it at the same time.

How to force it to build new cache layers?

gcloud config set builds/use_kaniko True
gcloud beta builds submit --tag="gcr.io/${PROJECT_NAME}/${name}" --timeout="2h" --machine-type="n1-highcpu-32"
like image 921
njho Avatar asked Dec 01 '25 20:12

njho


1 Answers

Turns out the --no-cache option will also replace the existing Kaniko cache

gcloud config set builds/use_kaniko True
gcloud beta builds submit --tag="gcr.io/${PROJECT_NAME}/${name}" --timeout="2h" --machine-type="n1-highcpu-32" --no-cache
like image 121
njho Avatar answered Dec 04 '25 07:12

njho



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!