gradle-docker
gradle-docker copied to clipboard
using with spring boot
As spring boot has its own task to create an executable jar I was wondering if this plugin will work with the bootRepackage task out of the box
Spring boot extends the gradle application plugin which is what gradle-docker is using so just add the spring boot plugin and the docker plugin and it'll work out of the box. Here's (relevant parts of) my build.gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:1.2.2.RELEASE"
classpath "se.transmode.gradle:gradle-docker:1.2"
}
}
apply plugin: "spring-boot"
apply plugin: "docker"
applicationDefaultJvmArgs = [
"-Dspring.profiles.active=docker,reverse-proxy"
]
distDocker {
exposePort 8080
}
Is there any way if to tell distDocker don't use the spring-boot functionality ...i mean like ADD <>.tar file and ENTRYPOINT.
by default it keep on adding to distDocker even if we want to use war file and run with standlone tomcat container.
You could replace the distDocker
task instead of extending it with task distDocker (overwrite: true)
See https://gradle.org/docs/current/userguide/more_about_tasks.html