Create paketo builder based on another Create paketo builder based on another docker docker

Create paketo builder based on another


At the moment, I do not believe there's a way to "extend" a builder. There is a Github issue open against the buildpacks spec though to add a feature like this. See here.

One option is to fully copy the builder.toml for the builder that you wish to extend. Then edit/modify it and create a new builder. This can be tricky as the builder.toml's are not, at the time I write this, published anywhere that's easy to find and copy them.

One alternative, which is probably closer to what you want anyway, is to make use of meta CNBs (a meta CNB is a collection of buildpacks). If you reference a meta CNB in the buildpacks section of your builder.toml, it will pull in all referenced buildpacks. You can then define your own custom order.

Ex:

[[buildpacks]]id = "paketo-buildpacks/node-engine"image = "gcr.io/paketo-buildpacks/node-engine:0.1.1"[[buildpacks]]id = "paketo-buildpacks/java"image = "gcr.io/paketo-buildpacks/java:3.1.0"[[order]]    [[order.group]]    id = "paketo-buildpacks/node-engine"    version = "0.1.1"    [[order.group]]    id = "paketo-buildpacks/java"    version = "3.1.0"[stack]  id = "io.buildpacks.stacks.bionic"  build-image = "gcr.io/paketo-buildpacks/build:base-cnb"  run-image = "gcr.io/paketo-buildpacks/run:base-cnb"

This example would add the node-engine CNB and make it run before the Java meta CNB. You could alternatively make it run after the Java meta CNB, or even define a custom order as you can reference the buildpack id/version of buildpacks included by your version of the meta CNB in the order groups.