Reputation: 475
Spring boot maven plugin is using paketo builder to build images.
gcr.io/paketo-buildpacks/builder:base-platform-api-0.3
What I would like to do is to add another step to what is being done by this builder. I've created my own buildpack and tried to create builder with base buildpacks included.
builder.toml
...
...
[[buildpacks]]
image = "my-own-buildpack"
[[buildpacks]]
image = "gcr.io/paketo-buildpacks/builder:base-platform-api-0.3"
...
First problem that I'm having is this error when trying to create a builder out of builder.toml:
ERROR: failed to add buildpacks to builder: extracting buildpacks from gcr.io/paketo-buildpacks/builder:base-platform-api-0.3: could not find label io.buildpacks.buildpackage.metadata
Another problem is that even if that worked I guess I would still have to specify all order.group from paketo:base.
Is there actually a way to create a builder out of paketo-buildpacks/builder without going into details of what is happening inside?
Upvotes: 1
Views: 1375
Reputation: 15041
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.
Upvotes: 4