Overview of Container Builder

Google Cloud Container Builder is a service that executes your builds on Google Cloud Platform's infrastructure.

Container Builder can import source code from a variety of repositories or cloud storage spaces, execute a build to your specifications, and produce artifacts such as Docker containers or Java archives.

Build configuration and build steps

You can write a build config to provide instructions to Container Builder on what tasks to perform. You can configure builds to fetch dependencies, run unit tests, static analyses, and integration tests, and create artifacts with build tools such as docker, gradle, maven, bazel, and gulp.

Container Builder executes your 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.

You can either use the build steps provided by Container Builder and the Container Builder community, or write your own custom build steps:

Each build step is run with its container attached to a local Docker network named cloudbuild. This allows build steps to communicate with each other and share data.

You can use standard Docker Hub images in Container Builder, such as Ubuntu and Gradle.

Starting builds

You can manually start builds in Container Builder using the gcloud command-line tool or the Container Builder API, or use Container Builder's build triggers feature to create an automated continuous integration/continuous delivery (CI/CD) workflow that starts new builds in response to code changes.

You can integrate build triggers with many code repositories, including Cloud Source Repository, GitHub, and Bitbucket.

Viewing build results

You can view your build results using the gcloud tool, the Container Builder API or use the Container Registry's build history menu in GCP Console, which displays details and logs for every build Container Builder executes. For instructions see Viewing Build Results.

How builds work

The following steps describe, in general, the lifecycle of a Container Builder build:

  1. Prepare your application code and any needed assets.
  2. Create a build config file in YAML or JSON format, which contains instructions for Container Builder.
  3. Submit the build to Container Builder.
  4. Container Builder executes your build based on the build config you provided.
  5. If applicable, any built images are pushed to Container Registry.

Container Builder interfaces

You can use Container Builder with the Google Cloud Platform Console, gcloud command-line tool, or Container Builder's REST API.

In the Google Cloud Platform Console, you can view the Container Builder build results in the Container Registry's Build history page, and automate builds in Build triggers.

You can use the gcloud tool to create and manage container builds. You can run commands to perform tasks such as submitting a build, listing builds, and canceling a build.

You can request builds using the Container Builder REST API.

As with other Cloud Platform APIs, you must authorize access using OAuth2. After you have authorized access, you can then use the API to start new builds, view build status and details, list builds per project, and cancel builds that are currently in process.

For more information, see the API documentation.

Running builds locally

If you want to test your build before submitting it to Container Builder, you can run your build locally using the container-builder-local tool. For instructions on using this tool see the Building and Debugging Locally page.

What's next

Send feedback about...

Cloud Container Builder