A builder
is an OCI image containing
an ordered combination of buildpacks and
a build-time base image, a lifecycle binary, and a reference to a runtime base image.
The build-time base image provides the base environment for the builder
(e.g., an Ubuntu Noble OS image with build tooling) and
a runtime base image provides the base environment for the app image
during runtime.
Under the hood a builder uses the lifecycle to run the detect
phase for all the buildpacks
it contains, in order,
and then proceeds to run the build
phase for all the buildpacks
that passed detection.
This allows us to have a single builder
that can detect and build various kinds of applications automatically.
For example, let’s say demo-builder
contains the Python
and Node
buildpack. Then -
requirements.txt
, demo-builder
will only run the Python build
steps.package-lock.json
, demo-builder
will only run the Node build
steps.package-lock.json
and requirements.txt
, demo-builder
will run both the Python and Node build
steps.demo-builder
will fail to detect
and exit.