gradle-docker icon indicating copy to clipboard operation
gradle-docker copied to clipboard

using with spring boot

Open Vad1mo opened this issue 10 years ago • 3 comments

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

Vad1mo avatar Dec 06 '14 16:12 Vad1mo

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
}

Raniz-at-Sony avatar Mar 26 '15 02:03 Raniz-at-Sony

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.

dhanugupta avatar Apr 17 '15 15:04 dhanugupta

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

mattgruter avatar Apr 17 '15 16:04 mattgruter