While looking through the documentation on gcp's build. I noticed that there are two paths for optimizing the build.
One was using --cache-from
as shown below
- name: 'gcr.io/cloud-builders/docker'
args: [
'build',
'-t', 'gcr.io/$PROJECT_ID/[IMAGE_NAME]:latest',
'--cache-from', 'gcr.io/$PROJECT_ID/[IMAGE_NAME]:latest',
'.'
]
And the other was to use Kaniko
. I am curious how these two paths are different in terms of optimizing the build speed. I think both path caches the layers and starts the build starting from the "changed" layer. Also I'd like to get input on which method ensures faster build.
Thank you!
As mentioned by Guillaume Blaquiere, both are the same things. But I would like to include best practices link for your reference.