Speeding up your builds
Whether you are just getting started or have been leveraging Cloud Build for a while, it’s always good to seek ways to reduce the amount of time it takes for a build to take place. The following is an example list:
- Specifying a
machineType
with more resources, such asstandard
,highmem
, andhighcpu
(covered in Chapter 2, Configuring Cloud Build Workers) - Parallelizing steps using
waitFor
(covered in Chapter 4, Build Configuration and Schema) - Leaner builder container images for each build step
- Caching intermediate image layers to be used in subsequent builds
The techniques for optimizing Docker images (https://docs.docker.com/develop/dev-best-practices/) also apply to Cloud Build builder images. The smaller the images are, the less time it takes for the Cloud Build worker to pull the image and begin executing the step. Having images that separate the dependencies for building application code and the libraries required to execute...