jre and jre-with-tools #93
-
Have you
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
For Alpine not (yet). We're still gathering customer feedback on whether we will have a supported Alpine image going forward. In the meantime you can follow our workaround documented in https://docs.microsoft.com/en-us/java/openjdk/containers |
Beta Was this translation helpful? Give feedback.
-
@dkirrane if you are in a Linux environment (or macOS), you can do something like this: jlink --add-modules $(java --list-modules) \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /javaruntime This will create a Java runtime that has all the modules available in the JDK you are building the runtime from. With some bash magic, you may be able to do an exclusionary set up (as in, add all modules except module A, B, and C). For packages such as Regarding Alpine, it is as @karianna said: we are still evaluating. |
Beta Was this translation helpful? Give feedback.
-
Found this while learning about jlink. Just wanted to say that at first I was nervous about not seeing a JRE image available and reading in the docs that the new approach is to build your own JRE using jlink. But the example in the docs was great. I was able to adapt the Dockerfile to my own use case (changing Java 11 to Java 16 and changing the COPY at the bottom so that my JAR was copied in) and ended up with a nice small image that was 46 MB compressed. I like this new approach of requiring users to build their own JREs but giving them ample documentation to help them do so. |
Beta Was this translation helpful? Give feedback.
@dkirrane if you are in a Linux environment (or macOS), you can do something like this:
jlink --add-modules $(java --list-modules) \ --strip-debug \ --no-man-pages \ --no-header-files \ --compress=2 \ --output /javaruntime
This will create a Java runtime that has all the modules available in the JDK you are building the runtime from. With some bash magic, you may be able to do an exclusionary set up (as in, add all modules except module A, B, and C).
For packages such as
jre-headless-with-tools
, the benefit in storage size is not significant to justify building and maintaining them compared to just using the JDK. For otherjre*
packages, the us…