This document defines
Builder images and the
conventions to which they are expected to adhere.
What is a Builder?
Builder image is a special classification for images that run as a part of
the Build CRD's
For example, in the following Build the images,
gcr.io/cloud-builders/docker are "Builders".:
spec: steps: - image: gcr.io/cloud-builders/gcloud ... - image: gcr.io/cloud-builders/docker ...
A Builder is typically a purpose-built container whose entrypoint is a tool that
performs some action and exits with a zero status on success. These entrypoints
are often command-line tools, for example,
mvn, and so on.
Typical builders set their
ENTRYPOINT) to be the command they
wrap and expect to take
args: to direct their behavior.
It it possible, although less typical to implement the Builder convention by
args: for example:
steps: - image: ubuntu command: ['/bin/bash'] args: ['-c', 'echo hello $FOO'] env: - name: 'FOO' value: 'world'
It is also possible for advanced users to create purpose-built builders. One example of this are the "FTL" builders.
What are the Builder conventions?
Builders should expect a Build to implement the following conventions:
/workspace: The default working directory will be
/workspace, which is a volume that is filled by the
source:step and shared across build
/builder/home: This volume is exposed to steps via
Credentials attached to the Build's service account may be exposed as Git or Docker credentials as outlined here.