OpenLiberty / devfile-stack

Application stack for Open Liberty
Apache License 2.0
10 stars 8 forks source link

Java 17 support devfile stack #210

Open NickWemekamp opened 2 years ago

NickWemekamp commented 2 years ago

Hi,

Are there plans to support Java 17 as well as Java 11 for the devfile-stack image? Because there are now official JDK 17 images available for Open Liberty but it looks open-liberty-devfile-stack:22.0.0.1 is using Java 11 only. Maybe we can have one devfile stack image with multiple JDK's installed or have a seperate image for JDK 17.

scottkurz commented 2 years ago

@NickWemekamp , we haven't decided yet but yes Java 17 is on our radar.

The devfile support is still in the early release stage. If it would help you to explore devfiles with Open Liberty and Java 17 at this early stage, we could provide some guidance to help walk you through that.

The function of the stack image is primarily for caching, to help the development pod start more quickly, and to speed up the eventual "outer loop" build as well. It's not exactly required though.

Feel free to let us know and thanks for your question.

NickWemekamp commented 2 years ago

@scottkurz Thanks for the fast reply.

We don't need Java 17 for the devfile stack image right now so we will wait it out. But I appreciate the offer! And I can always extend the dev image and add JDK17 manually or use a maven-jdk17 image without Open Liberty preinstalled as a workaround.

scottkurz commented 2 years ago

@scottkurz Thanks for the fast reply.

We don't need Java 17 for the devfile stack image right now so we will wait it out. But I appreciate the offer! And I can always extend the dev image and add JDK17 manually or use a maven-jdk17 image without Open Liberty preinstalled as a workaround.

Sure, glad to help.

ADJUSTING DEVFILE TO USE EXISTING IMAGE

I'll just mention quick anyway, the simplest way to pick up Java 17 would be to just reference a well-known image with Maven built in, e.g.: maven:eclipse-temurin at Docker Hub.

If you did this you'd want to remove the -DinstallDirectory=/opt/ol/wlp in each devfile 'mvn' command, since there's no pre-cached Open Liberty install to reference.

BUILDING YOUR OWN STACK IMAGE

Another, (a bit more complicated) approach would be to build your own stack image.

If you go this route, cloning/forking this repo and trying to run the same scripts we use would be unnecessary. (E.g. a typical user has no need to build both an Open Liberty AND a WebSphere Liberty image but just one or the other).

A simpler approach is just to start from the stack image Dockerfile at path: stack/open-liberty/image/maven/Dockerfile, modify it, build/push, update devfile, etc.

stack/open-liberty/image/maven/Dockerfile