Minimal Java Docker image focused on Java applications based on Amazon Corretto. It's use is intended for kool.dev, but can fit in any other Java use-case.
Automatically load classpath in applications using maven or gradle architecture.
The image built is kooldev/java
which has a bunch of tags available:
Variable | Default Value | Description |
---|---|---|
ASUSER | 0 |
Changes the user id that executes the commands |
UID | 0 |
Changes the user id that executes the commands (ignored if ASUSER is provided) |
VM_OPTIONS_XMS | 256m |
See Java Documentations |
VM_OPTIONS_XMX | 256m |
See Java Documentations |
VM_OPTIONS_MAX_METASPACE_SIZE | 256m |
See Java Documentations |
VM_OPTIONS_PERM_SIZE | 512m |
See Java Documentations |
VM_OPTIONS_XMN | 64m |
See Java Documentations |
VM_OPTIONS_SURVIVOR_RATIO | 128 |
See Java Documentations |
CMS_TRIGGER_PERCENT | 70 |
See Java Documentations |
JVM_FILE_ENCODING | UTF-8 |
See Java Documentations |
JVM_TTL | 60 |
See Java Documentations |
JVM_USER_LANGUAGE | en |
See Java Documentations |
JVM_USER_COUNTRY | US |
See Java Documentations |
TZ | Set default Timezone | |
JAVA_OPTIONS | Additional Java Options | |
RMI_SERVER_HOSTNAME | See Java Documentations | |
JVM_JMXREMOTE_PORT | See Java Documentations | |
JVM_JMXREMOTE_AUTHENTICATE | See Java Documentations | |
JVM_JMXREMOTE_SSL | See Java Documentations | |
DEBUG_PORT | 9000 |
Debug port |
DEBUG_SUSPEND | n |
Suspend debug to waiting attached |
CLASSPATH | Custom classpath, bay default defined by maven or gradle architecture | |
MAIN_CLASS | Class main, required by execute |
Variable | Default Value | Description |
---|---|---|
ASUSER | 0 |
Changes the user id that executes the commands |
UID | 0 |
Changes the user id that executes the commands (ignored if ASUSER is provided) |
VM_OPTIONS_XMS | 256m |
See Java Documentations |
VM_OPTIONS_XMX | 256m |
See Java Documentations |
VM_OPTIONS_MAX_METASPACE_SIZE | 256m |
See Java Documentations |
VM_OPTIONS_PERM_SIZE | 512m |
See Java Documentations |
VM_OPTIONS_XMN | 64m |
See Java Documentations |
VM_OPTIONS_SURVIVOR_RATIO | 128 |
See Java Documentations |
CMS_TRIGGER_PERCENT | 70 |
See Java Documentations |
JVM_FILE_ENCODING | UTF-8 |
See Java Documentations |
JVM_TTL | 60 |
See Java Documentations |
JVM_USER_LANGUAGE | en |
See Java Documentations |
JVM_USER_COUNTRY | US |
See Java Documentations |
TZ | Set default Timezone | |
JAVA_OPTIONS | Additional Java Options | |
JAR_FILE | /app/application.jar |
Jar file you application |
The developer version, you need mount your volume to maven and gradle.
- $HOME/.kool/m2:/home/kool/.m2
- $HOME/.kool/gradle:/home/kool/.gradle
In your application directory:
kool docker -e MAIN_CLASS=your.package.MainClass kooldev/java:8
To production version:
kool docker -e JAR_FILE=yout_application.jar kooldev/java:8-prod
Execute Jshell:
kool docker kooldev/java:11 jshell
docker run -it --rm kooldev/java:11 jshell
app:
image: kooldev/java:8
volumes:
- ".:/app:cached"
- "$HOME/.ssh/id_rsa:/home/developer/.ssh/id_rsa:cached"
environment:
ASUSER: "${$UID}"
You should change fwd-template.json
for configuration and template
folder for the actual base templates.
After any changes, we need to run kool run template
to parse the templates and generate all versions folder/files.
The MIT License (MIT). Please see License File for more information.