123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- //apply plugin: 'jar'
- //apply plugin: 'war'
- apply plugin: 'docker'
- apply plugin: 'application'
- buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
- classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
- classpath('se.transmode.gradle:gradle-docker:1.2')
- }
- }
- dependencies {
- compile project(":zen-api")
- compile project(':cloud-bus')
- }
- docker{
- baseImage 'openjdk:8-jdk-alpine'
- maintainer 'tina 976056042@qq.com'
- registry 'registry.cn-qingdao.aliyuncs.com'
- }
- task dockerBuilder(type: Docker) {
- registry='registry.cn-qingdao.aliyuncs.com/gxzc-envir'
- applicationName = 'fw'
- tagVersion = jar.version
- addFile("./build/libs/${jar.baseName}-${jar.version}.jar","app.jar")
- entryPoint(["java","-Djava.security.egd=file:/dev/./urandom","-jar",'app.jar'])
- exposePort(11000)
- doFirst {
- copy {
- from jar
- into stageDir
- }
- }
- push = true
- }
- dockerBuilder.dependsOn(bootJar)
- bootJar {
- enabled = true
- }
- jar {
- enabled = false
- }
- //实际上这个配置是没有用的,distDocker 打包出来的,启动不了
- startScripts{
- mainClassName='org.springframework.boot.loader.JarLauncher'
- }
|