Build time image customization for heroku/buildpacks:20

What is the best way to run a few quick on-off bash scripts specific to the fly production environment during build time with the heroku/buildpacks:20 ? Heroku supports adding buildpacks via GitHub URLS, but fly doesn’t seem to support that. Do I need to publish a docker image of a build pack to do this?

Fly does support additional buildpacks! For example:

  builder = "paketobuildpacks/builder:base"
  buildpacks = ["", ""]

Awesome! I’ll try that out. Sorry must have seen an old thread that said GitHub based build packs weren’t supported yet.

Ah, my mistake. I thought we had added this, but it’s not supported yet, sorry! That said, switching to using a Dockerfile would be a good way to do this.

Was just about to report back, builder errors out. I guess I would have to make a docker image of the build pack first? Anyone know of a simple reference example of doing that?

EDIT: docker file yeah. seems like that might be the best solution here.

Are you using a specific framework?

Node.js + fastify. I can also just run a post install script from package.json I think for simple stuff. I may have to switch over to docker if I need more extensive use of the system package manager.

If you don’t have a ton of complicated build steps, you could use something simple like this project: docker-fastify-restful-api/Dockerfile at main · pinceladasdaweb/docker-fastify-restful-api · GitHub

There you can add apk add ... if you need some other packages.

1 Like

Great! Thank you for the perfect example/template. This will make getting switched over a lot easier.