CatgirlIntelligenceAgency/docker-service.gradle
Viktor Lofgren dbe9235f3a (*) Upgrade to JDK21 with preview enabled.
... also move some common configuration into the root build.gradle-file.

Support for JDK21 in lombok is a bit sketchy at the moment, but it seems to work.  This upgrade is kind of important as the new index construction really benefits from Arena based lifecycle control over off-heap memory.
2023-09-24 10:38:59 +02:00

47 lines
1.3 KiB
Groovy

ext {
dockerImage='openjdk:21-slim'
serviceJvmOpts='--enable-preview -ea ${wmsa_jvm_param} -Dservice-host=0.0.0.0 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=4000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false'
serviceToolOpts='--enable-preview -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5000'
}
tasks.register('dockerFile') {
buildDir.mkdir()
var df = new File(buildDir, "Dockerfile")
doLast {
df.text = """#
# I'm auto-generated, please don't make changes to me or commit me to git
#
# The template exists in docker-service.gradle
#
FROM ${dockerImage}
ADD ${application.applicationName}.tar /
RUN mkdir /wmsa
ENV JAVA_TOOL_OPTIONS="${serviceToolOpts}"
ENV JAVA_OPTS="${serviceJvmOpts} "
ENTRYPOINT WMSA_HOME=/wmsa /${application.applicationName}/bin/${application.applicationName} \${arg0} \${arg1}
"""
}
it.outputs.file(df)
}
dockerPrepare {
dependsOn tasks.dockerFile
}
dockerfileZip {
dependsOn tasks.dockerFile
}
docker {
dockerfile = tasks.dockerFile.outputs.files.singleFile
name = 'marginalia.nu/'+application.applicationName+':latest'
files tasks.distTar.outputs
tags 'latest'
dependsOn tasks.distTar
}