Google Cloud Builders

 Cloud builders are container images with common languages and tools installed in them. You can configure Cloud Build to run a specific command within the context of these builders.

This page describes the types of builders that you can use with Cloud Build.

Cloud Build enables you to use any publicly available image to execute your tasks. To use an image, specify the image URL in the name field in your config file. Use the args field to specify commands that you want to run within the image. The args field of a build step takes a list of arguments and passes them to the image referenced by the name field.

The following code snippet shows how to use the public ubuntu image from Docker Hub and execute a command within that image:

steps:
- name: 'ubuntu'
  args
: ['echo', 'hello world']

Here's another example code snippet that uses the image for Black Duck open source scanner for Cloud Build from Google Cloud console Launcher:

steps:
- name: launcher.gcr.io/blackduck-public/blackducksoftware-containerbuilder-scanner
 
...

For more examples on how to use publicly available images from Docker Hub for your tasks, see Building Node.js applications and Building Go applications.

Cloud Build provides and maintains pre-built images that you can reference in your config file to execute your tasks. You can find these pre-built images in the following location:

gcr.io/cloud-builders/...

The source code for these builders is available in the cloud builders GitHub repository.

For examples on how to use supported pre-built images, see Building container images and Deploying to Cloud Run.

The following table lists some examples of supported builder images:

BuilderNameExample
bazelgcr.io/cloud-builders/bazelbazel example
dockergcr.io/cloud-builders/dockerdocker example
gitgcr.io/cloud-builders/gitgit example
gcloudgcr.io/cloud-builders/gcloudgcloud example
gke-deploygcr.io/cloud-builders/gke-deploygke-deploy example
gradlegcr.io/cloud-builders/gradlegradle example
mavengcr.io/cloud-builders/mvnmaven example
The complete list of supported builders for Cloud Build.

The Cloud Build developer community provides open-source builders that you can use to execute your tasks. Pre-built images are not available for these builders; to use these builders, download the source code from the cloud builders community GitHub repository and then build the image. For an example on how to build a community-contributed builder and then use it for your tasks, see Building VM images using Packer.

The following table lists some examples of community-contributed builders:

BuilderDescription
docker-composeRuns integration tests on docker images.
remote-builderExecutes your build step on a configurable Compute Engine VM.
packerAutomates the creation of machine images using Packer
helmManages Kubernetes packages using Helm.
packExecutes your build step using the specified Cloud Native Buildpack.
kanikoExecutes your build step using kaniko.
The complete list of community-contributed builders for Cloud Build.

Community-contributed builders are maintained by the open-source community at cloud builders community. Cloud Build does not officially maintain these builders. For information on contributing to a builder, see the cloud builders community GitHub page.

You can create your own custom builder for use in your builds. A custom builder is a container image that the Cloud Build pulls and runs with your source. Your custom builder can execute any script or binary inside the container; as such it can do anything a container can do. For instructions on creating a custom builder, see Creating custom build steps.

Comments

Popular posts from this blog

Terraform

Different Types of Reports in Scrum - Agile

Scrum Master Interview help - Bootcamp