This project demonstrates how to use a cloudbuild.yaml
to build an app usingGoogle Cloud's Buildpacks. This example will demonstrate how to take advantage of the --cache-image
mechanism to minimise build times.
You'll be using the following GCP APIs:
- Cloud Build
- Artifact Registry
You'll also need to have the gcloud
CLI installed
- Open
cloudbuild.yaml
- Update line 10 with your app image repository name and location
- Update line 14 with your cache image respository name and location
- In your terminal, run
gcloud builds submit
- The provided
cloudbuild.yaml
has a single step that utilizes thegcr.io/k8s-skaffold/pack
image. This is an image maintained by the Skaffold team and provides the Cloud Native Buildpackspack
CLI - We'll be following the instructions on using
--cache-image
mechanism to build- an app image (line 10)
- a cache image (line 14)
- First run of this will be relatively slow, generating both the app image and the cache image
- Subsequent runs will take advantage of the cache image to speed up build times