paketo-buildpacks / nodejs

A Cloud Native Buildpack for Node.JS
Apache License 2.0
57 stars 20 forks source link

How to integrate different buildpack versions into a single builder ? #846

Closed AshwinSridharan0410 closed 1 month ago

AshwinSridharan0410 commented 8 months ago

I am using a builder called abc, I want node versions 14,16,18,19,20 to participate in my builder. I want to integrate https://github.com/paketo-buildpacks/nodejs/releases/tag/v2.2.0 and https://github.com/paketo-buildpacks/nodejs/releases/tag/v1.8.0 in my builder, is it possible ?

https://github.com/paketo-buildpacks/nodejs/releases/tag/v2.2.0 - this contains node version14,16,18 https://github.com/paketo-buildpacks/nodejs/releases/tag/v1.8.0 - this contains node 16,18,19,20

contents of my builder.toml

[[buildpacks]] uri = "docker://xyz/paketo-buildpacks/nodejs:1.8.0" version = "1.8.0" [[buildpacks]] uri = "docker://xyz/paketo-buildpacks/nodejs:2.2.0" version = "2.2.0"

[[order]]

[[order.group]] id = "paketo-buildpacks/nodejs" version = "1.8.0"

[[order]]

[[order.group]] id = "paketo-buildpacks/nodejs" version = 2.2.0"

[stack] build-image = "xyz/stacks/build-stack/base:0.0.2" id = "io.buildpacks.stacks.jammy" run-image = "xyz/stacks/run-stack/base:0.0.2" run-image-mirrors = []

This wont work , to my knowledge as the buildpack is having the same id but different versions.

How to ensure that my usecase can be worked out ? Thank you

mhdawson commented 2 months ago

@AshwinSridharan0410 I think you will need to fork node-engine, add the additional versions of Node.js as dependencies in the toml file (https://github.com/paketo-buildpacks/node-engine/blob/main/buildpack.toml), and create your own builder with that forked version of node-engine.

pacostas commented 2 months ago

@AshwinSridharan0410 Havent tested it, but you might also be able to make it work by creating a buildpack with the node-engine versions you want https://buildpacks.io/docs/for-buildpack-authors/tutorials/basic-buildpack/02_building-blocks-cnb/ and add it in addition with the builder, e.g. pack build my-node-app --builder paketobuildpacks/builder-jammy-full --buildpack old-node-versions

mhdawson commented 1 month ago

There has not been a response from the original poster in quite some time going to close. Please let us know if that was not the right thing to do.