-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Alpine Linux #289
Closed
Closed
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that this hack IS required. Otherwise there is no possibility to deploy, since building the alpine version would overwrite the regular linux version!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, the platform + architecture combination should be the primary indicator about the binary compatibility for a shared library. Since the lib for alpine would not be compatible with "default" linux distros, it should have its own identifier here and should also be handled by the java LibraryLoader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did push a small fix, which is less hacky and actually works :D