builder.toml

The builder config file is used for creating builders.

The schema is as follows:

  • description (string, optional)

    A human-readable description of the builder, to be shown in builder inspect output (run pack builder inspect -h for more information).

  • buildpacks (list, optional)

    A list of buildpacks, each with the following fields:

    • id (string, optional)
      An identifier for the buildpack. Must match ID specified in buildpack’s buildpack.toml file.

    • version (string, optional)
      The version of the buildpack. Must match version specified in buildpack’s buildpack.toml file.

    • uri (string)
      A URL or path to an archive, a packaged buildpack (saved as a .cnb file), or a directory. If path is relative, it must be relative to the builder.toml.

  • order (list, required)

    A list of buildpack groups. This list determines the order in which groups of buildpacks will be tested during detection. Detection is a phase of the lifecycle where buildpacks are tested, one group at a time, for compatibility with the provided application source code. The first group whose non-optional buildpacks all pass detection will be the group selected for the remainder of the build. Each group currently contains a single required field:

    • group (list, required)
      A set of buildpack references. Each buildpack reference specified has the following fields:

      • id (string, required)
        The identifier of a buildpack from the configuration’s top-level buildpacks list. Buildpacks with the same ID may appear in multiple groups at once but never in the same group.

      • version (string, optional, default: inferred)
        The version of the buildpack being referred to. This field may be omitted if exactly one version of the buildpack occurs in either the top-level buildpacks list or those buildpacks’ dependencies.

      • optional (boolean, optional, default: false)
        Whether this buildpack is optional during detection.

  • build (required)

    Build-time information. It contains the following field:

    • image (required, string)
      Image to use as the build-time base
  • run (required)

    Run-time information. It contains the following:

    • run.images (list, required)
      A set of run image references. By default, the first run image specified will be used. Image extensions (experimental) may be used to switch the run image dynamically at build-time. Each run image reference has the following:

      • image (string, required)
        Image to use as the run-time base

      • mirrors (list, optional)
        Mirrors for the provided image

  • stack (optional, deprecated)

    The stack to use for the builder. See stack concept information for more details. This field should be specified if it is necessary to maintain compatibility with older platforms. If specified, the information in this field must be consistent with the build and run fields (see above). It contains the following:

    • id (required, string)
      Identifier for the stack

    • build-image (required, string)
      Build image for the stack

    • run-image (required, string)
      Run image for the stack

    • run-image-mirrors (optional, string list) Run image mirrors for the stack

  • lifecycle (optional)

    The lifecycle to embed into the builder. It must contain at most one the following fields:

    • version (string, optional)
      The version of the lifecycle (semver format) to download. If specified, uri must not be provided.

    • uri (string, optional)
      A URL or path to an archive. If specified, version must not be provided.

      If version and uri are both omitted, lifecycle defaults to the version that was last released at the time of pack’s release. In other words, for a particular version of pack, this default will not change despite new lifecycle versions being released.

  • build.env (optional)

    The [[build.env]] is used to specify operator-defined build-time environment variables for buildpacks. Set CNB_BUILD_CONFIG_DIR in pack’s environment to override the default directory (/cnb/build-config/env) where environment variable files are stored within the builder.

    • name (string, required)
      The name/key of the environment variable.

    • value (string, required)
      The value of the environment variable.

    • suffix (string, optional)
      The type of action used to modify the environment variable when end-users or buildpacks define the same name/key, one of default, override, append, or prepend. Defaults to default if this field is omitted. Operator-defined environment variables take precedence over end-user or buildpack-defined environment variables.

    • delim (string, optional)
      The delimiter used to concatenate two or more values for the given name.

    The delim is required when suffix is one of append or prepend.

Supported archives

Currently, when specifying a URI to a buildpack or lifecycle, only tar or tgz archive types are supported.