You may specify exactly what buildpacks are used during the build process by referencing them with a URI in any of the following formats.
|CNB Builder Resource||
|CNB Registry Resource||
When a string does not include a scheme prefix (ex.
docker://) and also does not match a path on the filesystem, a platform may attempt to resolve it to a URI in the following order:
If you need to disambiguate a particular reference, use a fully qualified URI.
--buildpack parameter accepts a URI in any of the formats described above.
For this example we will use a few buildpacks from our samples repo.
# clone the repo git clone https://github.com/buildpacks/samples # build the app pack build sample-java-maven-app \ --builder cnbs/sample-builder:alpine \ --buildpack samples/java-maven \ --buildpack samples/buildpacks/hello-processes/ \ --buildpack docker://cnbs/sample-package:hello-universe \ --path samples/apps/java-maven/
Multiple buildpacks can be specified, in order, by supplying:
--buildpackmultiple times, or
- a comma-separated list to
project.toml format allows for Buildpack URIs to be specified in the
[[build.buildpacks]] table with the
[project] id = "sample-java-maven-app" name = "Sample Java App" version = "1.0.0" [[build.buildpacks]] uri = "samples/java-maven" [[build.buildpacks]] uri = "samples/buildpacks/hello-processes/" [[build.buildpacks]] uri = "docker://cnbs/sample-package:hello-univers"
A path to a directory†,
tar file, or
A URL to a
tgz file containing a buildpackage
A Docker image containing a buildpackage
A buildpack located in a CNB Builder
A buildpack located in a CNB Registry
† Directory buildpacks are not currently supported on Windows.
‡ Version may be omited if there is only one buildpack in the builder matching the