10

Is there one equivalent of Google's JIB or BuildPacks for Node.JS ?

It is my understanding that JIB allows to build OCI container images from within the project's build tool like Gradle or Maven, as a developer we only have to include a plugin into the build and are able to package up the application into a container and having JIB implement all the best practices of packing up a Java application into container with no questions asked.

I have search around but have not found something equivalent for the Node.JS ecosystem. It should be possible just into a node developer time dependency and it take care on packaging up my javascript/typescript Express.js for example app into a docker container or OCI image.

Thank you, Oscar

Luis Trigueiros
  • 636
  • 7
  • 21

4 Answers4

4

For posterity, I'll list some NodeJS-native Docker image creation packages (these usually can be added to your project's package.json). In no particular order:

I did try Dockta and it has SUPER simple one-liner docker file/image build (either a simple package.json script or direct command line), it works nicely.

Big Rich
  • 5,864
  • 1
  • 40
  • 64
  • 1
    According to the documentation when it says: "...gives instructions on how to invoke Docker's build process.", and other parts, EZDocker needs docker to be available and reachable in some host. JIB (as per question asked) does not require any of them. Same for Dockta. Documentation says: "If you want to use Dockta to build Docker images, you will need to install Docker if you don't already have it." – Davide Martorana Oct 29 '21 at 17:10
  • @davide79, when I answered this, it was really me doing a 'dump' of the tools I'd found while looking for JIB-like Docker image builders for JavaScript-based projects. I may not have fully considered whether the Docker CLi is required, or not, just the resulting image, but I do concede this is a valid observation. – Big Rich Oct 31 '21 at 00:51
3

Yes, Heroku has a Node.js Buildpack. You can run it using the Pack CLI like this:

$ pack build myimage --builder heroku/buildpacks:18 --buildpack heroku/nodejs
codefinger
  • 10,088
  • 7
  • 39
  • 51
0

If you are using GitLab, you can simply use Kaniko as well.

Alex
  • 230
  • 1
  • 2
  • 19
0

Using docker registry api, maybe node-oci-image-builder could help you.

Tyler2P
  • 2,324
  • 26
  • 22
  • 31