forked from drywolf/J2V8
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds support for building a musl flavored J2V8 version, by providing a Alpine dockerfile to cross-compile J2V8 inside. Also fixes install.maven.sh in case install.java.sh was not run beforehand (opt folder creation)
- Loading branch information
1 parent
d339049
commit 35703d1
Showing
7 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import constants as c | ||
from cross_build import BuildStep, PlatformConfig | ||
from docker_build import DockerBuildSystem | ||
import config_linux as lc | ||
|
||
alpine_config = PlatformConfig(c.target_alpine, [c.arch_x86, c.arch_x64], DockerBuildSystem) | ||
|
||
alpine_config.cross_config(BuildStep( | ||
name="cross-compile-host", | ||
platform=c.target_alpine, | ||
host_cwd="$CWD/docker", | ||
build_cwd="/j2v8", | ||
)) | ||
|
||
alpine_config.set_file_abis({ | ||
c.arch_x64: "x86_64", | ||
c.arch_x86: "x86" | ||
}) | ||
|
||
# Alpine build steps are the same as for linux - just the build environment is different | ||
alpine_config.build_step(c.build_node_js, lc.build_node_js) | ||
alpine_config.build_step(c.build_j2v8_cmake, lc.build_j2v8_cmake) | ||
alpine_config.build_step(c.build_j2v8_jni, lc.build_j2v8_jni) | ||
alpine_config.build_step(c.build_j2v8_java, lc.build_j2v8_java) | ||
alpine_config.build_step(c.build_j2v8_junit, lc.build_j2v8_junit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM library/openjdk:8u131-alpine | ||
|
||
RUN mkdir -p /temp/docker/shared/ | ||
WORKDIR /temp/docker/shared/ | ||
|
||
# NOTE: copy shared scripts and run them separately | ||
# this helps when changing commands only in a single script, | ||
# since it will not requrie rebuilding all docker image layers | ||
# but just the ones that were affected | ||
|
||
COPY ./shared/install.alpine.packages.sh /temp/docker/shared | ||
RUN ./install.alpine.packages.sh | ||
|
||
COPY ./shared/install.maven.sh /temp/docker/shared | ||
RUN ./install.maven.sh | ||
ENV PATH "$PATH:/opt/apache-maven-3.5.0/bin" | ||
|
||
# download the most critical maven dependencies for the build beforehand | ||
COPY ./shared/pom.xml /temp | ||
WORKDIR /temp | ||
RUN export J2V8_PLATFORM_NAME=temp && \ | ||
export J2V8_ARCH_NAME=temp && \ | ||
mvn verify -DskipTests || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
echo "Preparing Alpine packages..." | ||
apk add --update --no-cache \ | ||
git \ | ||
unzip \ | ||
gcc \ | ||
g++ \ | ||
curl \ | ||
file \ | ||
python \ | ||
make \ | ||
cmake \ | ||
wget \ | ||
supervisor \ | ||
bash \ | ||
linux-headers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
|
||
echo "Preparing Maven..." | ||
curl http://www-eu.apache.org/dist/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz -O | ||
mkdir -p /opt | ||
tar xzvf apache-maven-3.5.0-bin.tar.gz -C /opt/ | ||
chmod -R 777 /opt/apache-maven-3.5.0 |