Play 2.8.0 using JDK 13 on Slim Alpine Docker
I made an attempt to create a custom JLink image to trim it down further, but didn't succeed. See the deps directory for details.
The first thing you should do is install SDKMAN and jenv, which will let you be specific about what JDK version you want.
Install SDKMAN and jenv
SDKMAN is the best way to pick out different versions of Java and have them all co-exist.
jenv is the best way to set different JDKs for different projects.
You can install multiple JDKs and have them available. Here, we'll use the OpenJDK 13.0.1 image.
$ sdk install java 13.0.1.hs-adpt
After that, you can see the JDK available in
Now that you've got the JDK available, let's tell jenv about it:
$ jenv add $HOME/jenv add $HOME/.sdkman/candidates/java/13.0.1.hs-adpt
And then we'll set it as the default for this project.
$ jenv local 13.0
This will create a
.java-version file in your directory that picks up and points you to the JDK.
$ java --version openjdk 13.0.1 2019-10-15 OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.1+9) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.1+9, mixed mode, sharing)
Now you're running JDK 13 for your project.
Publish a local docker image with
Run the local image with
docker run \ -p 9000:9000 \ --rm \ --env "PLAY_APPLICATION_SECRET=very-long-secret-for-entropy" \ slimmest-play-example:latest
Then go to http://localhost:9000.
Monitoring and Control Plane
Diagnostics and control of the JVM is managed through Jolokia running as an agent. You can control the JVM and see how the GC is running by running Hawt in another console window:
java -jar hawt/hawtio-app-2.8.0.jar
Or by running
Once hawt is up and running, add the connection as "http://localhost:8778/jolokia" and from there you can see GC and dump JFR logs.
Logs are exported from