vegardit / docker-graalvm-maven Goto Github PK
View Code? Open in Web Editor NEWDocker image to build native Linux binaries from Java Maven projects using GraalVM native-image feature.
License: Apache License 2.0
Docker image to build native Linux binaries from Java Maven projects using GraalVM native-image feature.
License: Apache License 2.0
The version names are confusing and unclear in indicating which version is associated with which tool.
There is a GLibC incompatibility
INIT_START Runtime Version: provided:al2.v20 Runtime Version ARN: arn:aws:lambda:eu-west-1::runtime:e448fca582d6ef7f5f1faf3cae4b2bb6521010ebae50e60019812234a4c0d549
./runner: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by ./runner)
./runner: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by ./runner)
graalvm-maven:22.3.2-java17 is OK
Building vanilla Quarkus project https://quarkus.io/ fails with the following error:
...
[3/7] Building universe... (9.7s @ 2.30GB)
[4/7] Parsing methods... [******] (43.7s @ 2.24GB)
[5/7] Inlining methods... [*****] (31.8s @ 2.83GB)
[6/7] Compiling methods... [*************] (185.0s @ 4.01GB)
[7/7] Creating image... (0.0s @ 3.31GB)
Fatal error: java.lang.RuntimeException: There was an error linking the native image: Linker command exited with 1
Based on the linker command output, possible reasons for this include:
1. It appears as though libstdc++.a is missing. Please install it.
Linker command executed:
/usr/bin/gcc -z noexecstack -Wl,--gc-sections -Wl,--dynamic-list -Wl,/tmp/SVM-6638468409718322790/exported_symbols.list -Wl,--exclude-libs,ALL -Wl,-x -o /mnt/space/work/default/target/core-1.0.0-SNAPSHOT-native-image-source-jar/core-1.0.0-SNAPSHOT-runner core-1.0.0-SNAPSHOT-runner.o /opt/graalvm/lib/svm/clibraries/linux-amd64/liblibchelper.a /opt/graalvm/lib/static/linux-amd64/glibc/libnet.a /opt/graalvm/lib/static/linux-amd64/glibc/libextnet.a /opt/graalvm/lib/static/linux-amd64/glibc/libnio.a /opt/graalvm/lib/static/linux-amd64/glibc/libmanagement_ext.a /opt/graalvm/lib/static/linux-amd64/glibc/libjava.a /opt/graalvm/lib/static/linux-amd64/glibc/libfdlibm.a /opt/graalvm/lib/static/linux-amd64/glibc/libsunec.a /opt/graalvm/lib/static/linux-amd64/glibc/libzip.a /opt/graalvm/lib/svm/clibraries/linux-amd64/libjvm.a -v -L/tmp/SVM-6638468409718322790 -L/opt/graalvm/lib/static/linux-amd64/glibc -L/opt/graalvm/lib/svm/clibraries/linux-amd64 -lstdc++ -lpthread -ldl -lz -lrt -no-pie
Linker command output:
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-gcn/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Debian 10.2.1-6)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-z' 'noexecstack' '-o' '/mnt/space/work/default/target/core-1.0.0-SNAPSHOT-native-image-source-jar/core-1.0.0-SNAPSHOT-runner' '-v' '-L/tmp/SVM-6638468409718322790' '-L/opt/graalvm/lib/static/linux-amd64/glibc' '-L/opt/graalvm/lib/svm/clibraries/linux-amd64' '-no-pie' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/10/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/10/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper -plugin-opt=-fresolution=/tmp/ccnI24fI.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o /mnt/space/work/default/target/core-1.0.0-SNAPSHOT-native-image-source-jar/core-1.0.0-SNAPSHOT-runner -z noexecstack /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/10/crtbegin.o -L/tmp/SVM-6638468409718322790 -L/opt/graalvm/lib/static/linux-amd64/glibc -L/opt/graalvm/lib/svm/clibraries/linux-amd64 -L/usr/lib/gcc/x86_64-linux-gnu/10 -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/10/../../.. --gc-sections --dynamic-list /tmp/SVM-6638468409718322790/exported_symbols.list --exclude-libs ALL -x core-1.0.0-SNAPSHOT-runner.o /opt/graalvm/lib/svm/clibraries/linux-amd64/liblibchelper.a /opt/graalvm/lib/static/linux-amd64/glibc/libnet.a /opt/graalvm/lib/static/linux-amd64/glibc/libextnet.a /opt/graalvm/lib/static/linux-amd64/glibc/libnio.a /opt/graalvm/lib/static/linux-amd64/glibc/libmanagement_ext.a /opt/graalvm/lib/static/linux-amd64/glibc/libjava.a /opt/graalvm/lib/static/linux-amd64/glibc/libfdlibm.a /opt/graalvm/lib/static/linux-amd64/glibc/libsunec.a /opt/graalvm/lib/static/linux-amd64/glibc/libzip.a /opt/graalvm/lib/svm/clibraries/linux-amd64/libjvm.a -lstdc++ -lpthread -ldl -lz -lrt -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/10/crtend.o /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crtn.o
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
at com.oracle.svm.hosted.image.NativeImageViaCC.handleLinkerFailure(NativeImageViaCC.java:505)
at com.oracle.svm.hosted.image.NativeImageViaCC.write(NativeImageViaCC.java:452)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:695)
at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:515)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:407)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:585)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)
at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:615)
------------------------------------------------------------------------------------------------------------------------
56.6s (11.6% of total time) in 102 GCs | Peak RSS: 5.45GB | CPU load: 1.93
=========================================================================================
Failed generating 'core-1.0.0-SNAPSHOT-runner' after 8m 6s.
Error: Image build request failed with exit status 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
Probably compatibility issue with most recent GraalVM. Is it possible for you to tag your Docker image releases with GraalVM version?
[root@localhost DataCenter]# docker run --rm -it \
-v $PWD:/mnt/myproject:rw
-w /mnt/myproject
vegardit/graalvm-maven:latest-java17
mvn clean package
The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.
Hope to support arm64 to facilitate the construction and use of arm computer (m1)
Hello,
Just wanted to reach out regarding a small issue with this image.
I am trying to build an app with maven and graalvm
The app is attached here as zip, it is a minimal reproducible issue, no extra business logic.
On localhost, meaning not with this image, but the host has maven, docker, graalvm, same as the image, running this command, the build happens without issue.
However, with this image, running this command (as per the tutorial) docker run --rm -it -v $PWD:/mnt/myproject:rw -w /mnt/myproject vegardit/graalvm-maven:22.0.1 mvn -Pnative spring-boot:build-image -DskipTests
reproducible 100% of the time, there is this error:
[INFO] Building jar: /mnt/myproject/target/vegarditissue-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot:3.3.0-RC1:repackage (repackage) @ vegarditissue ---
[INFO] Replacing main artifact /mnt/myproject/target/vegarditissue-0.0.1-SNAPSHOT.jar with repackaged archive, adding nested dependencies in BOOT-INF/.
[INFO] The original artifact has been renamed to /mnt/myproject/target/vegarditissue-0.0.1-SNAPSHOT.jar.original
[INFO]
[INFO] <<< spring-boot:3.3.0-RC1:build-image (default-cli) < package @ vegarditissue <<<
[INFO]
[INFO]
[INFO] --- spring-boot:3.3.0-RC1:build-image (default-cli) @ vegarditissue ---
[INFO] Building image 'docker.io/library/vegarditissue:0.0.1-SNAPSHOT'
[INFO]
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder-jammy-tiny:latest' 100%
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:09 min
[INFO] Finished at: 2024-05-15T00:20:12Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.3.0-RC1:build-image (default-cli) on project vegarditissue: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.3.0-RC1:build-image failed: Connection to the Docker daemon at '/var/run/docker.sock' failed with error "[2] No such file or directory"; ensure the Docker daemon is running and accessible: com.sun.jna.LastErrorException: [2] No such file or directory -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Could you please help download this issue zip?
Then, could you help run this and let me know if you are able to reproduce this issue as well?
While I understand I can "mount /var/run/docker.sock myself", would it be possible to have it?
Thank you for your help.
Hello team,
I am using this image to build containers.
The container works fine, this image is great.
Unfortunately, we have daily scans of images built with these images.
All images are being flagged using openssl-3.0.2, which has many vulnerabilities.
May I ask if it is possible to bump openssl to a safe version?
Thank you
Hello team,
This is my first ticket.
I have been using this project for long, really, just thank you.
Java 22 is around the corner.
Could you please support java 22 as well?
Thank you
Hi,
First of all thanks a lot for this awesome image. Such a time saver piece of work and we are actively using it in our native builds.
As you may know, in the last week, the team released the newest version of the GraalVM. Is there any plan to support it in the pipeline? Or should we solve this out by ourselves?
A New GraalVM Release and New Free License!
Cheers,
Korkut.
I use vegardit/graalvm-maven:latest-java11 in docker to run service read data from mysql
my url connection: jdbc:mysql://{myip:myport}/{mydatabase}?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false
raw data: Tập đoàn T&T Group hợp tác chiến lược toàn diện với Tập đoàn VNPT
read data: T?p ?o?n T&T Group h?p t?c chi?n l??c to?n di?n v?i T?p ?o?n VNPT
When i use maven:3.6.3-jdk-11 everything is fine
Hello,
This is my first post in this repo, if not anything else, big thanks for this project.
I have been using the vegardit/graalvm-maven:22.3.2-java17 for a while now, very happy, many thanks.
With Java 21 Ga, production ready, GraalVM team is also getting ready.
May I ask if this project can help support java 21 as well? Some kind of vegardit/graalvm-maven:X-java21
Thank you for your time
This is a great project. Are there any plans to support windows?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.