Skip to content
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

Java 21 upgrade #1405

Open
olivierboudet opened this issue Sep 19, 2023 · 62 comments
Open

Java 21 upgrade #1405

olivierboudet opened this issue Sep 19, 2023 · 62 comments

Comments

@olivierboudet
Copy link

Hi,

Java 21 is GA, when can we hope to have an updated distroless image ?

thanks

@zapodot
Copy link

zapodot commented Sep 20, 2023

Looks like we need an image based on Debian 13 (trixie) to support this

@theFoxley
Copy link

Why ? There was java17 on debian11 even if it's not the default jre for this version

@loosebazooka
Copy link
Member

If there's Java 21 on debian12, we'll add it. Perhaps a question to the debian maintainers?

@sansnom
Copy link

sansnom commented Sep 22, 2023

For me, it will be available. You can follow the package here: openjdk-21. But will need to wait for a few weeks (took one month for JDK 17). Minimum of 5 days between unstable and testing if I read well and then to stable.

EDIT: has been migrated to testing the 2023/09/26. Next step: testing->stable.

@fragaLY
Copy link

fragaLY commented Oct 4, 2023

Hi,

Is it going to be released?)

@loosebazooka
Copy link
Member

Is it available in debian?

@fragaLY
Copy link

fragaLY commented Oct 12, 2023

Looks like we need an image based on Debian 13 (trixie) to support this

So we are going to wait till the 2025?

What is the problem to base on the debian12 (yes, I know support date of Debian 12 till 2028 and JDK21 till 2031)?

@dlorenc
Copy link
Contributor

dlorenc commented Oct 12, 2023

Shameless pointer, the wolfi-based Chainguard images are distroless as well and we just announced support for jdk 21:

 % syft cgr.dev/chainguard/jdk
 ✔ Loaded image                                                                                                                                                                                                                                                      cgr.dev/chainguard/jdk:latest
 ✔ Parsed image                                                                                                                                                                                                            sha256:c888584441cad85816725ae80ea8d874f623b67eab0240a24d6c62361111b2c4
 ✔ Cataloged packages              [54 packages]
NAME                    VERSION      TYPE
busybox                 1.36.1-r2    apk
ca-certificates-bundle  20230506-r0  apk
fontconfig-config       2.14.2-r2    apk
freetype                2.13.2-r1    apk
glibc                   2.38-r5      apk
glibc-locale-en         2.38-r5      apk
glibc-locale-posix      2.38-r5      apk
java-cacerts            20230106-r1  apk
java-common             0.1-r0       apk
jrt-fs                  21           java-archive
ld-linux                2.38-r5      apk
libbrotlicommon1        1.1.0-r0     apk
libbrotlidec1           1.1.0-r0     apk
libbz2-1                1.0.8-r5     apk
libcrypt1               2.38-r5      apk
libexpat1               2.5.0-r4     apk
libfontconfig1          2.14.2-r2    apk
libgcc                  13.2.0-r3    apk
libpng                  1.6.40-r0    apk
libstdc++               13.2.0-r3    apk
openjdk-21              21.35-r1     apk
openjdk-21-default-jdk  21.35-r1     apk
openjdk-21-default-jvm  21.35-r1     apk
openjdk-21-jre          21.35-r1     apk
openjdk-21-jre-base     21.35-r1     apk
wolfi-baselayout        20230201-r6  apk
zlib                    1.3-r0       apk

There's also a jre build:

% syft cgr.dev/chainguard/jre
 ✔ Pulled image
 ✔ Loaded image                                                                                                                                                                                                                                                      cgr.dev/chainguard/jre:latest
 ✔ Parsed image                                                                                                                                                                                                            sha256:6a519b42584aeaceaf029624f026c5f5157d5fda04c1843b58e13f00df3f71c4
 ✔ Cataloged packages              [45 packages]
NAME                    VERSION      TYPE
ca-certificates-bundle  20230506-r0  apk
fontconfig-config       2.14.2-r2    apk
freetype                2.13.2-r1    apk
glibc                   2.38-r5      apk
glibc-locale-en         2.38-r5      apk
glibc-locale-posix      2.38-r5      apk
java-cacerts            20230106-r1  apk
java-common             0.1-r0       apk
jrt-fs                  21           java-archive
ld-linux                2.38-r5      apk
libbrotlicommon1        1.1.0-r0     apk
libbrotlidec1           1.1.0-r0     apk
libbz2-1                1.0.8-r5     apk
libexpat1               2.5.0-r4     apk
libfontconfig1          2.14.2-r2    apk
libgcc                  13.2.0-r3    apk
libpng                  1.6.40-r0    apk
libstdc++               13.2.0-r3    apk
openjdk-21-default-jvm  21.35-r1     apk
openjdk-21-jre          21.35-r1     apk
openjdk-21-jre-base     21.35-r1     apk
wolfi-baselayout        20230201-r6  apk
zlib                    1.3-r0       apk

@loosebazooka
Copy link
Member

Fundamentally it's easiest for us to do what debian does. I know we special case nodejs. And maybe we can do the same for Java -- we just don't right now. The wolfi images (or any other vendor) could fill the gap for you here until we find a Java 21 build.

@ding-ma
Copy link

ding-ma commented Oct 13, 2023

I managed to build Java 21 and Python 3.12 distroless images based off of the debian SID release channel. I created my own debian package fetch script which generates a file similar to debian_archives.bzl.

Since I maintain a fork of this project at work, I can talk to my manager if I can contribute a part of my work back to this project. If I were to contribute back, we would need to modify the debian_package_manager so that it is able to fetch from the SID channel.

@loosebazooka
Copy link
Member

I think we're just going to use temurin to do this: #1444

@loosebazooka
Copy link
Member

loosebazooka commented Oct 31, 2023

So there should be some java21 images ready for testing. If you are using Java21, we would appreciate some feedback on if these are working for you.

gcr.io/distroless/java21-debian12 (amd64, arm64 and ppc64le). They are based on adoptium temurin java21 which does not seem to currently have an s390x build, so if you're using s390x you might be out of luck.

@swi-jared
Copy link

@loosebazooka I'm testing it now, and so far the only hiccup is that I had to upgrade jib which is probably good to do anyway (something about an unsupported image format). If there are any further hiccups I'll add them here.

Thanks!

@loosebazooka
Copy link
Member

loosebazooka commented Nov 1, 2023

Glad to hear it's working, @swi-jared you probably should've run into that issue a while ago? Since we moved to oci media types (vs old docker media types) a few months ago.

@jochenberger
Copy link

I'm also running tests, looks good so far. 👍

@swi-jared
Copy link

Glad to hear it's working, @swi-jared you probably should've run into that issue a while ago? Since we moved to oci media types (vs old docker media types) a few months ago.

This particular service has been using Temurin 17's base image, so we haven't run into this issue yet.

@apostoliska
Copy link

apostoliska commented Nov 2, 2023

Hi all,

I am testing the java 21 distroless image and find some differences compared to Java 17 related to cacerts.

I am loading a custom trust store to /etc/ssl/certs/java/cacerts (through a volume) but is looks that it is ignored since the relevant symbolic link is missing.

Java 17:

/usr/lib/jvm/java-17-openjdk-amd64/lib/security $ ls -la
total 8
drwxr-xr-x 2 root root 4096 Jul 24 09:57 .
drwxr-xr-x 1 root root 4096 Jul 24 09:57 ..
lrwxrwxrwx 1 root root 43 Jul 24 09:57 blocked.certs -> /etc/java-17-openjdk/security/blocked.certs
lrwxrwxrwx 1 root root 27 Jul 24 09:57 cacerts -> /etc/ssl/certs/java/cacerts
lrwxrwxrwx 1 root root 44 Jul 24 09:57 default.policy -> /etc/java-17-openjdk/security/default.policy
lrwxrwxrwx 1 root root 52 Jul 24 09:57 public_suffix_list.dat -> /etc/java-17-openjdk/security/public_suffix_list.dat

Java 21:

/usr/lib/jvm/temurin21_jdk_amd64/lib/security $ ls -la
total 436
drwxr-xr-x 2 root root 4096 Jan 1 2000 .
drwxr-xr-x 5 root root 4096 Jan 1 2000 ..
-r-xr-xr-x 1 root root 2488 Jan 1 2000 blocked.certs
-r-xr-xr-x 1 root root 188019 Jan 1 2000 cacerts
-r-xr-xr-x 1 root root 10657 Jan 1 2000 default.policy
-r-xr-xr-x 1 root root 229405 Jan 1 2000 public_suffix_list.dat

@loosebazooka
Copy link
Member

Yeah looks like temurin ships it's own certs. Probably makes sense to just use those? Or in your script replace those files?

@apostoliska
Copy link

Yes, I can try to mount my trust store to /usr/lib/jvm/temurin21_jdk_amd64/lib/security/cacerts.

I think this change should be noted. Using a custom trust store is quite frequent.

@loosebazooka
Copy link
Member

Its not clear to me if we should add the symlinks and move the certs over to be consistent with the debian?

@jochenberger
Copy link

jochenberger commented Nov 2, 2023

IMHO, it would be best to stay compatible with previous releases of java*-debian* so this can be a drop-in replacement.

@apostoliska
Copy link

Its not clear to me if we should add the symlinks and move the certs over to be consistent with the debian?

I believe having the symlinks would be preferable to simplify the upgrade (at least in my case). After all, openjdk 17 has its own cacerts as well and the symlinks were there.

@christopher-cudennec
Copy link

Hey everyone!
Since #1444 is already merged: Will you also add gcr.io/distroless/java21-debian12 to the list of available images in your documentation?
Thanks,
Christopher

@loosebazooka
Copy link
Member

loosebazooka commented Nov 3, 2023

Hrmm... Also wondering if we should use temurins shipped trust root or the debian one. Using temurins would simplify our code a bit.

@apostoliska
Copy link

I think that gcr.io/distroless/java17-debian12 used the cacerts shipped with Debian.

If that's the case, I believe the same should apply for java 21.

@loosebazooka
Copy link
Member

Hr... that is the case, however, the debian java distributions also ship blocked.certs, default.policy and public_suffix_list.dat separately with the JRE install and we will be missing those. Using those could result in some mismatch?

It's looking like we should just use the temurin install as is (easier to maintain, and how temurin generally behaves). Java users will be expected to inject their custom roots directly into the jvm directory as documented in the Java README?

@apostoliska
Copy link

There is another issue that I am facing.

I am using the below images:

  • gcr.io/distroless/java21-debian12:nonroot
  • gcr.io/distroless/java21-debian12:debug-nonroot

I mount a custom cacerts to /usr/lib/jvm/temurin21_jdk_amd64/lib/security/cacerts . The application is performing an HTTPS request to a service that its certificated is loaded to the custom cacerts.

The results for each image are the following:

  • debug-nonroot: No issue is observed
  • nonroot: I get the below error. The custom cacerts appears to be ignored.

Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(Unknown Source)
at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(Unknown Source)
at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(Unknown Source)
at java.base/sun.security.ssl.SSLHandshake.consume(Unknown Source)
at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source)
at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(Unknown Source)
at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask.run(Unknown Source)
at io.netty.handler.ssl.SslHandler.runDelegatedTasks(SslHandler.java:1647)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1493)
at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1334)
... 18 common frames omitted
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at java.base/sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at java.base/sun.security.validator.Validator.validate(Unknown Source)
at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
... 30 common frames omitted
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at java.base/java.security.cert.CertPathBuilder.build(Unknown Source)
... 35 common frames omitted

The issue is resolved by running the app with the following parameter:

-Djavax.net.ssl.trustStore=/usr/lib/jvm/temurin21_jdk_amd64/lib/security/cacerts

However, adding the parameter should not be required as this is the default cacerts location. Additionally, there is a mismatch in the behavior between nonroot and debug-nonroot images. I find no other difference apart from the image tag.

Any ideas?

@ding-ma
Copy link

ding-ma commented Nov 7, 2023

I'm still working on open sourcing the code. I'll submit PR once it is approved and you guys can decide which version to keep. The builds are based off of debian sid channel so it would be similar to the current java 17 builds.

@apostoliska, debug image contain java jdk whereas non-debug image does not.

I was wondering if we could make a jdk image without busybox. We would have the following:

  1. gcr.io/distroless/java21-debian12:{latest,debug...}
  2. gcr.io/distroless/java21-jdk-debian12:{latest,debug...}

The debug tag will only container busybox.

@loosebazooka
Copy link
Member

@apostoliska I think @ding-ma answered your questions, but the detail is that regular images are jres, not jdks. So you need to use the jre path: /usr/lib/jvm/temurin21_jre_amd64/lib/security/cacerts But also maybe the names don't have to be different. Maybe both jre and jvm can just install to the same locaiton.

@pstackle
Copy link

I'll add myself as being in support of having separate images with the JDK versus the JRE. I had previously been operating under the assumption that the only difference between the debug and non-debug images was busybox being installed, so was surprised when I learned that the java debug image also used a JDK install instead of a JRE install.

I was wondering if we could make a jdk image without busybox.

My hope would be to also have a JRE image with busybox.

@loosebazooka
Copy link
Member

#1459 was merged, any chance you could try your old workflows again and see if everything is working as expected (write your custom certs into /etc/ssl/certs/java/cacerts)

@apostoliska
Copy link

Verified from my side. Thank you for your efforts.

@Booyaabes
Copy link

Tested successfully here too. Thx

Nevertheless, I notice a different behavior between java21-debian12:(latest|nonroot) images, and all others java images.
I can run without error this kind of command with non-java21 images:

docker run --rm -v "$(pwd)"/test/CheckCerts.java:/app/CheckCerts.java --entrypoint="java" gcr.io/distroless/java17-debian11:nonroot /app/CheckCerts.java

or even with java21 debug image:

docker run --rm -v "$(pwd)"/test/CheckCerts.java:/app/CheckCerts.java --entrypoint="java" gcr.io/distroless/java21-debian12:debug-nonroot /app/CheckCerts.java

But with gcr.io/distroless/java21-debian12:(latest|nonroot) image, I get the following error:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.InternalError: Module jdk.compiler not in boot Layer
        at java.base/sun.launcher.LauncherHelper.loadModuleMainClass(Unknown Source)
        at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

Do you have any clue of what's going on ?

@pstackle
Copy link

@Booyaabes
I believe this is due to the difference that is being discussed above where the debug image has the JDK while the non-debug image only has a JRE (no JDK == no compiler).

from @ding-ma

debug image contain java jdk whereas non-debug image does not.

from @loosebazooka

I think @ding-ma answered your questions, but the detail is that regular images are jres, not jdks.

@loosebazooka
Copy link
Member

Hrmm.. I think the implication was that the java17 jre images were able to do this?

@Booyaabes
Copy link

Distroless Java 11 & Java 17 images were able to do this, exactly.
Should non-debug Java 21 image behaves as non-debug Java 11 & 17 images ?
Or non-debug Java 11 & 17 images should not have had the compiler ?
What should be the correction ?

@swi-jared
Copy link

In the spirit of distroless, I would prefer a smaller footprint and only include the jre. However, if history says it includes the full jdk that's not a deal-breaker. Perhaps there's room for image tags like gcr.io/distroless/{java,jre}21-debian12, where (perhaps) java includes the jdk, and jre includes only the jre?

Just a thought.

@loosebazooka
Copy link
Member

I don't think we'll publish a non debug jdk image. Although at some point you should be able to just build them yourself using rules distroless.

@jonesetc
Copy link

jonesetc commented Dec 5, 2023

An issue that I've run into that caused a huge headache is that jspawnhelper is not executable on java21-debian12. This causes all process spawning (ProcessBuilder as the main example) to fail by default. Here's a way to look at it (running on arm64 which effects the paths below)

# bad
> docker run -it --rm --entrypoint ls gcr.io/distroless/java21-debian12:debug -l /usr/lib/jvm/temurin21_jdk_arm64/lib/jspawnhelper
-rw-r--r--    1 root     root         72448 Jan  1  2000 /usr/lib/jvm/temurin21_jdk_arm64/lib/jspawnhelper

# good
> docker run -it --rm --entrypoint ls gcr.io/distroless/java17-debian12:debug -l /usr/lib/jvm/java-17-openjdk-arm64/lib/jspawnhelper
-rwxr-xr-x    1 root     root         67488 Oct 31 23:39 /usr/lib/jvm/java-17-openjdk-arm64/lib/jspawnhelper

to reproduce:

  • create a file hello-ls.java
import java.lang.ProcessBuilder;

class HelloLs {
    public static void main(String[] args) throws Exception {
        new ProcessBuilder("ls").inheritIO().start().waitFor();
    }
}
  • compile with java 17 (so you can try on both versions) javac hello-ls.java
  • run with java 17 image to see it work
> docker run --rm -it -v "$PWD/HelloLs.class:/HelloLs.class" --entrypoint java gcr.io/distroless/java17-debian12:debug HelloLs
HelloLs.class  boot           dev            home           proc           run            sys            usr
bin            busybox        etc            lib            root           sbin           tmp            var
  • run with java 21 image to see it not work
> docker run --rm -it -v "$PWD/HelloLs.class:/HelloLs.class" --entrypoint java gcr.io/distroless/java21-debian12:debug HelloLs
Exception in thread "main" java.io.IOException: Cannot run program "ls": error=13, Permission denied
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at HelloLs.main(hello-ls.java:5)
Caused by: java.io.IOException: error=13, Permission denied
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
	... 2 more
  • do it again, but first make the helper executable
> docker run --rm -it -v "$PWD/HelloLs.class:/HelloLs.class" --entrypoint sh gcr.io/distroless/java21-debian12:debug
/ # chmod +x /usr/lib/jvm/temurin21_jdk_arm64/lib/jspawnhelper
/ # java HelloLs
HelloLs.class  boot           dev            home           proc           run            sys            usr
bin            busybox        etc            lib            root           sbin           tmp            var
  • bonus, change launch strategy to see it work with a workaround
> docker run --rm -it -v "$PWD/HelloLs.class:/HelloLs.class" --entrypoint java gcr.io/distroless/java21-debian12:debug -Djdk.lang.Process.launchMechanism=vfork HelloLs
HelloLs.class  boot           dev            home           proc           run            sys            usr
bin            busybox        etc            lib            root           sbin           tmp            var

@loosebazooka
Copy link
Member

We can make jspawnhelper executable

@loosebazooka
Copy link
Member

I haven't had a chance to figure out why @Booyaabes issue is popping up though

@Glup3
Copy link

Glup3 commented Feb 8, 2024

hey, are there any updates on this?

@loosebazooka
Copy link
Member

loosebazooka commented Feb 8, 2024

I think I might need to use something different than the bazel pkg_tar rule. I'll throw something together but it'll be brittle if the directory layout or executable permissions change on the jre archive.

@jhawkins1
Copy link

What is the ETA of publishing Java 21 Debian 12 Image as one of the supported Distroless Images? Do you need additional testers? Seems like this was moving along, but stalled?

@loosebazooka
Copy link
Member

loosebazooka commented Apr 22, 2024

I mean it's probably good to go now. I'm not super fond of how I'm unpacking the tar in https://github.com/GoogleContainerTools/distroless/blob/main/private/remote/temurin_archive.bzl but I guess that's just an implementation detail.

@markallanson
Copy link

I have some feedback on the Java21 images.

In the Java17 images, config was symlinked from a common location in /etc/java-17-openjdk - a common directory without any architecture specifications.

This made it easy to build derived base images with tweaked config.

The currently published java21 images don't symlink in the config, which makes things a bit more annoying to deal with.

@loosebazooka
Copy link
Member

@markallanson can you provide a little more detail? We can probably fix this pretty easily. We're just going to end up organizing a temurin package like a debian java release.

@markallanson
Copy link

markallanson commented Apr 25, 2024

In the Java17 image as an example, configuration, properties, and policies are stored in the etc/java-17-openjdk directory.

All output taken from the dive tool.

│ Current Layer Contents ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────
Permission     UID:GID       Size  Filetree
drwxr-xr-x         0:0     422 kB  ├── etc
drwxr-xr-x         0:0     422 kB  │   └── java-17-openjdk
-rw-r--r--         0:0      391 B  │       ├── accessibility.properties
drwxr-xr-x         0:0      72 kB  │       ├── jfr
-rw-r--r--         0:0      36 kB  │       │   ├── default.jfc
-rw-r--r--         0:0      36 kB  │       │   └── profile.jfc
-rw-r--r--         0:0       54 B  │       ├── jvm-amd64.cfg
-rw-r--r--         0:0     2.7 kB  │       ├── logging.properties
drwxr-xr-x         0:0      18 kB  │       ├── management
-rw-r--r--         0:0     4.0 kB  │       │   ├── jmxremote.access
-rw-r--r--         0:0      14 kB  │       │   └── management.properties
-rw-r--r--         0:0     6.6 kB  │       ├── net.properties
-rw-r--r--         0:0     3.8 kB  │       ├── psfont.properties.ja
-rw-r--r--         0:0      11 kB  │       ├── psfontj2d.properties
drwxr-xr-x         0:0     306 kB  │       ├── security
-rw-r--r--         0:0     2.5 kB  │       │   ├── blocked.certs
-rw-r--r--         0:0      10 kB  │       │   ├── default.policy
-rw-r--r--         0:0     2.2 kB  │       │   ├── java.policy
-rw-r--r--         0:0      57 kB  │       │   ├── java.security
-rw-r--r--         0:0      106 B  │       │   ├── nss.cfg
drwxr-xr-x         0:0     4.1 kB  │       │   ├── policy
-rw-r--r--         0:0     2.4 kB  │       │   │   ├── README.txt
drwxr-xr-x         0:0     1.4 kB  │       │   │   ├── limited
-rw-r--r--         0:0      146 B  │       │   │   │   ├── default_US_export.policy
-rw-r--r--         0:0      647 B  │       │   │   │   ├── default_local.policy
-rw-r--r--         0:0      566 B  │       │   │   │   └── exempt_local.policy
drwxr-xr-x         0:0      339 B  │       │   │   └── unlimited
-rw-r--r--         0:0      146 B  │       │   │       ├── default_US_export.policy
-rw-r--r--         0:0      193 B  │       │   │       └── default_local.policy
-rw-r--r--         0:0     229 kB  │       │   └── public_suffix_list.dat
-rw-r--r--         0:0     1.2 kB  │       ├── sound.properties
-rw-r--r--         0:0      113 B  │       └── swing.properties

Taking a single file, java.security as an example, that's symlinked from the actual java deploy in /usr/lib/jvm/<version>-<arch>/conf/security. The same pattern follows for all the other configuration files in /etc.

│ Current Layer Contents ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────
Permission     UID:GID       Size  Filetree
drwxr-xr-x         0:0      57 kB  ├── etc
drwxr-xr-x         0:0      57 kB  │   └── java-17-openjdk
drwxr-xr-x         0:0      57 kB  │       └── security
-rw-r--r--         0:0      57 kB  │           └── java.security
drwxr-xr-x         0:0        0 B  └── usr
drwxr-xr-x         0:0        0 B      └── lib
drwxr-xr-x         0:0        0 B          └── jvm
drwxr-xr-x         0:0        0 B              └── java-17-openjdk-amd64
drwxr-xr-x         0:0        0 B                  ├── conf
drwxr-xr-x         0:0        0 B                  │   └── security
-rwxrwxrwx         0:0        0 B                  │       └── java.security → /etc/java-17-openjdk/security/java.security

In the current Java21 images this layout does not store config at all in /etc.

@Incluuu
Copy link

Incluuu commented May 2, 2024

Java 21 only on Debian 12, will support also cover Debian 11?

@loosebazooka
Copy link
Member

No, Debian 11 is eol pretty soon.

@abdennour
Copy link

Hello guys, this is reminder! What's the plan ? Do we have any showstopper ?

expected to have the image available under: distroless/java21-debian13

@jhawkins1
Copy link

What is the status / ETA of the publishing Java21 as an official Distroless Debian12 Image?

@loosebazooka
Copy link
Member

once we get #1582, we should be able to publish them.

@nmendybayev
Copy link

Hi, I see that the Java 21 images are still in working in progress. However, I already can see the image in gcr.io/distroless/java21-debian12. What is that? Is that beta?

The reason I am asking is I have tried that image and found some issue related to some missing packages. This is the detail #1636

I don't know about if it is possible to use gcr.io/distroless/java21-debian12 for production but just tested it and it worked.

@loosebazooka
Copy link
Member

Yeah I think we're about ready to advertise it

@gbaso
Copy link

gbaso commented Sep 25, 2024

I see gcr.io/distroless/java21-debian12 in the README. Should the image be considered production ready? Any reasons why this issue is still open?

@loosebazooka
Copy link
Member

We seem to have reached parity with the existing images. So if that works for you then sure. There's one open issue around random number generation algorithms -- but that's not something distroless can fix.

@GregDThomas
Copy link

There's one open issue around random number generation algorithms

Do you have a reference? Appreciate it's not a distroless problem, but could be a show stopper depending on what it is.

@loosebazooka
Copy link
Member

#1636

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests