This image contains the Micronaut CLI, Java-25 GraalVM, and SDKMAN on Rocky Linux 9. This allows you to build and run Micronaut applications using GraalVM. Everything is installed with SDKMAN, so you can easily switch between different versions of Java.
First, run a container with a shell:
$ docker run -p 8080:8080 --rm -it sourcemation/micronaut:latest
Being inside the container, create a new Micronaut application:
$ mn create-app example.sourcemation.testapp --build=maven --lang=java
Then, go to the application's directory, run tests to check if everything is OK and build a native-image application.
$ cd testapp
$ ./mvnw test
$ ./mvnw package -Dpackaging=native-image
After running these commands inside your local container, run the application
with /home/micronaut/testapp/target/testapp. Example listing:
[micronaut@664a3ed677a9 testapp]$ /home/micronaut/testapp/target/testapp
__ __ _ _
| \/ (_) ___ _ __ ___ _ __ __ _ _ _| |_
| |\/| | |/ __| '__/ _ \| '_ \ / _` | | | | __|
| | | | | (__| | | (_) | | | | (_| | |_| | |_
|_| |_|_|\___|_| \___/|_| |_|\__,_|\__,_|\__|
20:54:19.413 [main] INFO io.micronaut.runtime.Micronaut - Startup completed in 15ms. Server Running: http://664a3ed677a9:8080
This image exposes the following ports:
Please note that the ports need to be either manually forwarded with the
-p option or let Docker choose some for you with the -P option.
Your contributions are valued! Feel free to suggest enhancements or request new images by opening an issue, or submit your own contributions via pull requests to the Sourcemation GitHub repository.
Disclaimer: The sourcemation/micronaut image is not affiliated with the
Micronaut Foundation. The respective companies and organisations own the
trademarks mentioned in the offering. The sourcemation/micronaut image is a
separate project and is maintained by Sourcemation.
The base image user is micronaut, and the working directory is
/home/micronaut.
The native images require the gcc, glibc-devel and zlib-devel; they are
installed in this image by default.
This image does not have the JAVA_HOME variable set.
A detailed risk analysis report of the image and its components can be found on the Sourcemation platform.
For more information, check out the official Micronaut website, and the "Creating your first Micronaut app" guide.
The base license for the solution (Micronaut version 5.2.2) is the Apache License, Version 2.0. The licenses for each component shipped as part of this image can be found on the image's appropriate Sourcemation entry.
Content type
Image
Digest
sha256:c0cec5723…
Size
968.4 MB
Last updated
4 days ago
docker pull sourcemation/micronaut