-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add Java SubstrateVM Base Image #217
Comments
cc @patflynn |
Using Docker multistage this is easy.
|
@dlorenc My first thought is that the distroless/base is the right base-image for this kind of executable. Could we just add libz to it? |
Adding items like libz could open the door for adding more and more. The user and the user's build environment can add items like this when and where needed. The tooling is there. |
We could stick this in cc, which is what the java base uses. That would still keep base clean, and provide a slimmer base for java without the JVM. |
@dlorenc this has come up again. Any objections to putting this in the cc image? Looks like the java image pulls in |
potential CL: #294 |
I wonder if this ends up only serving the Java case, and is perhaps a bad way to go about this. Every other language that depends on Is the actual solution to publish something like |
would a good example of multistage builds help solve these queries? |
@lathama I think your example is fine, it's an effective strategy for users who have docker. In the jib case, it's less obvious how to do this, I'm just trying to find a good way to go about it. |
Could creating a solution for JIB benefit more long term? |
I think with java11 and tooling around minimizing the JRE, there is a potential for use. |
I don't have any preferences. |
We now have multistage build examples in the documentation, closing. |
Note that |
I encountered this issue and use The problem is that even copy
|
Shameless plug - if you get a chance, could you try cgr.dev/chainguard/glibc-dynamic? It's an alternative to distroless/base but with a more modern glibc. I think we use 2.41 now. |
@dlorenc do we have a better channel to continue this thread? I'm afraid that it's a bit offensive to discuss here. Anyway, I try the image and it shows that I should still try to install libz.so myself. Copy share lib from another image seems tricky:
|
I opened an issue and cc'ed you there - chainguard-images/images#171 |
Closing the loop for everyone, there's now a dedicated graal image published here: https://github.com/chainguard-images/images/tree/main/images/graalvm-native-image-base |
Thank you @dlorenc for the link. FYI: the dir was renamed, new link: https://github.com/chainguard-images/images/tree/main/images/graalvm-native |
It would be nice to see a base image which could be used to generate distroless docker images which contain an app which was build using GraalVM SubstrateVM. SubstrateVM generates static compiled native executables of Java Programs which do not require an additional JVM environment.
I was able to run such images using the
gcr.io/distroless/base
image by adding thelibz.so.1
. I saw that the java base image is already containing the lib.Example docker file:
I'm not familiar with Bazel but it should be easy to just copy the java build env and remove the JRE from the build.
The text was updated successfully, but these errors were encountered: