Code Monkey home page Code Monkey logo

prebuildify-cross's Introduction

prebuildify-cross

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.

Install

Depends on having Docker installed, as well as prebuildify and node-gyp:

npm install --save-dev prebuildify node-gyp prebuildify-cross

Usage

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 (ghcr.io). 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 ghcr.io/prebuild/<image> and if these don't contain a tag they're further expanded to ghcr.io/prebuild/<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 ..

When working in a monorepo, where ./node_modules does not contain the dependencies that prebuildify-cross relies upon, a custom path can be provided with --modules. It can be an absolute path or relative to the current working directory. For example:

prebuildify-cross --modules ../../node_modules -i linux-armv7:latest -t 20.0.0 --strip

Images

References

License

GPL-3.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.