2023-03-04 13:19:01 +01:00
|
|
|
ext {
|
|
|
|
dockerImage='openjdk:17-slim'
|
|
|
|
serviceJvmOpts='-Dservice-host=0.0.0.0 -ea -Dsmall-ram=true ${wmsa_jvm_param} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=4000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false'
|
|
|
|
serviceToolOpts='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5000'
|
|
|
|
}
|
|
|
|
|
2023-03-12 10:04:48 +01:00
|
|
|
tasks.register('dockerFile') {
|
|
|
|
buildDir.mkdir()
|
2023-03-11 12:13:53 +01:00
|
|
|
|
2023-03-12 10:04:48 +01:00
|
|
|
var df = new File(buildDir, "Dockerfile")
|
|
|
|
doLast {
|
|
|
|
df.text = """#
|
2023-03-04 13:19:01 +01:00
|
|
|
# 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}
|
|
|
|
"""
|
2023-03-12 10:04:48 +01:00
|
|
|
}
|
|
|
|
it.outputs.file(df)
|
|
|
|
}
|
|
|
|
|
|
|
|
dockerPrepare {
|
|
|
|
dependsOn tasks.dockerFile
|
|
|
|
}
|
2023-03-10 17:16:44 +01:00
|
|
|
|
2023-03-12 10:04:48 +01:00
|
|
|
dockerfileZip {
|
|
|
|
dependsOn tasks.dockerFile
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
docker {
|
|
|
|
dockerfile = tasks.dockerFile.outputs.files.singleFile
|
2023-03-04 13:19:01 +01:00
|
|
|
name = 'marginalia.nu/'+application.applicationName+':latest'
|
|
|
|
files tasks.distTar.outputs
|
|
|
|
tags 'latest'
|
|
|
|
dependsOn tasks.distTar
|
|
|
|
}
|