diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d0317a1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +# Build linux prebuild binary + +# syntax=docker/dockerfile:1 +FROM centos:centos7 +RUN yum install centos-release-scl-rh -y +RUN yum install rh-nodejs12 -y +RUN yum install python3 -y +RUN yum install devtoolset-7 -y diff --git a/README.md b/README.md index 2cb449c..9c2fd1d 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,26 @@ qjsc.getSupportedVersions(); ``` node-gyp configure -- -f gyp.generator.compile_commands_json.py ``` + +**Prebuild linux binary** + +1. Install docker +2. Build local image with Dockerfile + ``` + docker build -t qjsc . + ``` +3. Enter into images + ``` + docker run --rm -it -v $(pwd):/project qjsc + ``` +4. Set up env in docker container + ``` + cd project + scl enable rh-nodejs12 bash + scl enable devtoolset-7 bash + ``` +5. Build your binary + ``` + npm install + npm run prebuild + ``` diff --git a/package-lock.json b/package-lock.json index bd44231..b178ac2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "qjsc", - "version": "0.2.8", + "version": "0.2.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 778b516..e4cfa61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qjsc", - "version": "0.2.9", + "version": "0.2.10", "description": "Node.js addon for the Quickjs compiler", "main": "index.js", "bin": { diff --git a/prebuilds/linux-x64/node.napi.node b/prebuilds/linux-x64/node.napi.node index c978225..d9f9016 100755 Binary files a/prebuilds/linux-x64/node.napi.node and b/prebuilds/linux-x64/node.napi.node differ