Compile prebuilds in Docker

Downloads in past


1635.0.02 years ago5 years agoMinified + gzip package size for prebuildify-cross in KB


Compile prebuilds in Docker, supporting Linux (including Debian 8, Ubuntu 14.04, RHEL 7, CentOS 7 and up), Alpine Linux, ARM Linux devices like the Raspberry Pi and mobile ARM devices like Android.
Runs prebuildify in preconfigured prebuild/docker-images containers to compile and name prebuilds for a certain platform. This means you don't have to worry about GCC flags, environment variables or system dependencies. In addition, prebuildify-cross copies only npm package files to Docker (following the rules of .npmignore and files) and mounts node_modules removing the need for a repeated npm install.


Depends on having Docker installed, as well as prebuildify and node-gyp:
npm install --save-dev prebuildify node-gyp prebuildify-cross


The prebuildify-cross cli forwards all command line arguments to prebuildify, but adds an --image or -i argument. For example, the following command will invoke prebuildify -t 8.14.0 --napi --strip in a CentOS container and copy the resulting prebuild to ./prebuilds:
prebuildify-cross -i centos7-devtoolset7 -t 8.14.0 --napi --strip

To build for more than one platform, multiple --image arguments may be passed:
prebuildify-cross -i linux-armv7 -i linux-arm64 -t ..

By default prebuild/docker-images are used which are publicly hosted on the GitHub Container Registry ( It's possible to use custom images with e.g. -i my-namespace/my-image. Image arguments that don't contain a forward slash are expanded to<image> and if these don't contain a tag they're further expanded to<image>:<version> where version is currently 2.
To use latest images (not recommended) an image tag must be specified explicitly. For example:
prebuildify-cross -i linux-armv7:latest -t ..