ext { dockerImage='openjdk:21-slim' } 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 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 }