qvest-digital / openjdk-alpine-j2v8

Alpine based OpenJDK 8 image with musl compiled J2V8 bindings
https://hub.docker.com/r/tarent/openjdk-alpine-j2v8/
MIT License
0 stars 1 forks source link

Can't build 8-jdk-j2v8-4-8 image #2

Open gcusnieux opened 5 years ago

gcusnieux commented 5 years ago

Hello, I want to build the image 8-jdk-j2v8-4-8 but returns a compilation error certainly since the Alpine updates. Do you have an idea ?

make[1]: *** [deps/v8/src/v8_base.target.mk:577: /data/J2V8/node/out/Release/obj.target/v8_base/deps/v8/src/heap/heap.o] Error 1
make[1]: Leaving directory '/data/J2V8/node/out'
make: *** [Makefile:73: node] Error 2
The command '/bin/sh -c apk add --update --virtual build-dependencies wget git g++ python linux-headers alpine-sdk binutils-gold --no-cache &&     mkdir /data/ && cd /data/ && git clone https://github.com/eclipsesource/J2V8.git && cd /data/J2V8/ && git checkout 0828fcd5ac2a0f4281e7a5ef913da8cd5a993ac9 &&     export CCFLAGS="${CCFLAGS} -fPIC" CXXFLAGS="${CXXFLAGS} -fPIC" CPPFLAGS="${CPPFLAGS} -fPIC" &&     cd /data/J2V8/ && sh ./build-node.sh &&     cd /data/J2V8/jni &&     g++ -I ../node -I ../node/deps/v8 -I ../node/deps/v8/include         -I ../node/src -I $JAVA_HOME -I $JAVA_HOME/linux          com_eclipsesource_v8_V8Impl.cpp -std=c++11 -fPIC -shared -o /usr/lib/libj2v8_linux_x86_64.so         -Wl,--whole-archive ../node/out/Release/obj.target/libnode.a -Wl,--no-whole-archive         -Wl,--start-group                           ../node/out/Release/obj.target/deps/v8/src/libv8_libbase.a                           ../node/out/Release/obj.target/deps/v8/src/libv8_libplatform.a                           ../node/out/Release/obj.target/deps/v8/src/libv8_base.a                           ../node/out/Release/obj.target/deps/v8/src/libv8_nosnapshot.a                           ../node/out/Release/obj.target/deps/v8/src/libv8_libsampler.a                           ../node/out/Release/obj.target/deps/uv/libuv.a                           ../node/out/Release/obj.target/deps/openssl/libopenssl.a                           ../node/out/Release/obj.target/deps/http_parser/libhttp_parser.a                           ../node/out/Release/obj.target/deps/gtest/libgtest.a                           ../node/out/Release/obj.target/deps/zlib/libzlib.a                           ../node/out/Release/obj.target/deps/cares/libcares.a         -Wl,--end-group         -lrt -z noexecstack -D NODE_COMPATIBLE=1 &&     strip --strip-unneeded -R .note -R .comment /usr/lib/libj2v8_linux_x86_64.so &&     apk del build-dependencies &&     rm -rf /var/cache/apk/* &&     rm -rf /data/' returned a non-zero code: 2
arzt commented 5 years ago

Try to fix the alpine version in the Dockerfile by changing FROM openjdk:8-jdk-alpine to FROM openjdk:8-jdk-alpine3.8

Using newest alpine is not working because its g++ version is currently not supported for compiling node.js. Alternatively you can copy the artifact from existing image e.g. adding this line to your Dockerfile: COPY --from=tarent/openjdk-alpine-j2v8:8-jdk-j2v8-4.6 /usr/lib/libj2v8_linux_x86_64.so /usr/lib/libj2v8_linux_x86_64.so