-
Overview
- Builds container images with common languages and tools
- Can use publicly available image to execute tasks
- Runs build steps in a Docker container
- Provides and maintains pre-built images
- Pre-built images are located in Container Registry
- The source code for builders is in cloud builders GitHub repository
- Cloud Build developer community provides open-source builders
- Pre-built images not available for open-source builders
- Download the source code from the cloud builders community GitHub repository and then build the image
-
Build Step
- Executes build as a series of build steps, where each build step is run in a Docker container
- Executing build steps is analogous to executing commands in a script
- Steps executed serially on the same machine
- Steps field is defined in build config file
- Build steps are provided by Cloud Build, Cloud Build community, or custom build steps
- Can execute build tool packaged into a container
- waitFor option controls sequential steps
- Each build step is run with its container attached to a local Docker network named cloudbuild
- Docker network allows build steps to communicate with each other and share data
- Dockerfile can be used to build the image by executing Docker builds in Cloud Build using the gcloud tool or build triggers
- A build config file can be used in addition to Dockerfile to provide more customisation to the build
- Standard Docker Hub images can be used in Cloud Build, such as Ubuntu and Gradle
-
Build Config File
- Contains custom specifications for performing tasks
- Contains instructions to build, package, and push Docker images
- Defines parts of the task to execute
- Builds can fetch dependencies, run unit tests, static analyses, and integration tests, and create artifacts with build tools such as docker
-
Starting Builds
- Manually start builds in Cloud Build using the gcloud command-line tool
- Use the Cloud Build API, or Cloud Build's build triggers feature to create an automated continuous integration/continuous delivery (CI/CD) workflow that starts new builds in response to code changes
- Integrate build triggers with code repositories, including Cloud Source Repositories, GitHub, and Bitbucket
-
View Builds
- gcloud tool
- Cloud Build API
- Build History page in the Cloud Build section in Cloud Console
-
Compliance
- Customer-Managed Encryption Keys (CMEK) compliance by encrypting the build-time persistent disk (PD) with an ephemeral key
- Key is uniquely generated for each build
- Key is wiped from memory as soon as build begins
- Key is not stored anywhere and is not accessible to Google engineers or support staff