Skip to content

Commit

Permalink
Merge branch 'master' of github.com:criblio/js2bin
Browse files Browse the repository at this point in the history
  • Loading branch information
Ledion Bitincka committed Jun 17, 2022
2 parents 531f76a + c5e855b commit 54aae3e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
14 changes: 14 additions & 0 deletions Dockerfile.centos6.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM centos:7

# use node 10 as it's guaranteed to run on CentOS6
RUN yum install -y centos-release-scl && \
yum install -y devtoolset-7 python27 wget && \
wget -q https://nodejs.org/dist/v10.23.0/node-v10.23.0-linux-arm64.tar.gz && \
tar -xf node-v10.23.0-linux-arm64.tar.gz && \
rm node-v10.23.0-linux-arm64.tar.gz && \
ln -s /node-v10.23.0-linux-arm64/bin/node /bin/node && \
ln -s /node-v10.23.0-linux-arm64/bin/npm /bin/npm

# to buid using this container you need to enable the right slc toolchain ie
# scl enable devtoolset-7 '<your-build-command-here>'

8 changes: 0 additions & 8 deletions Dockerfile.ubuntu

This file was deleted.

2 changes: 1 addition & 1 deletion build-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ if [ $(docker buildx ls | grep js2bin-builder | wc -l) -eq 0 ]; then
docker buildx create --name js2bin-builder
fi
docker buildx use js2bin-builder
docker buildx build -t "cribl/js2bin-builder:latest-nonx64" --platform linux/arm64/v8 --push -f Dockerfile.ubuntu .
docker buildx build -t "cribl/js2bin-builder:latest-nonx64" --platform linux/arm64/v8 --push -f Dockerfile.centos6.arm64 .
docker build -t "cribl/js2bin-builder:latest" -f Dockerfile.centos6 .
docker push "cribl/js2bin-builder:latest"
5 changes: 2 additions & 3 deletions src/NodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,15 @@ class NodeJsBuilder {
}

buildInContainerNonX64(arch) {
const containerTag = 'cribl/js2bin-builder:latest-nonx64';
const containerTag = 'cribl/js2bin-builder:next-nonx64';
return runCommand(
'docker', ['run',
'--platform', arch,
'-e', 'FORCE_PYTHON2=true',
'-v', `${process.cwd()}:/js2bin/`,
'-t', containerTag,
'/bin/bash', '-c',
`cd /js2bin && npm install && ./js2bin.js --ci --node=${this.version} --size=${this.placeHolderSizeMB}MB`
// `source /opt/rh/devtoolset-7/enable && source /opt/rh/python27/enable && cd /js2bin && npm install && ./js2bin.js --ci --node=${this.version} --size=${this.placeHolderSizeMB}MB`
`cd /js2bin && npm install && scl enable devtoolset-7 './js2bin.js --ci --node=${this.version} --size=${this.placeHolderSizeMB}MB'`
]
);
}
Expand Down

0 comments on commit 54aae3e

Please sign in to comment.