Created
March 7, 2019 06:57
-
-
Save shrikarvk/dab3947b0c6e14c9c81b731c694656f2 to your computer and use it in GitHub Desktop.
build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
maven { | |
url "https://plugins.gradle.org/m2/" | |
} | |
mavenCentral() | |
} | |
dependencies { | |
classpath('org.springframework.boot:spring-boot-gradle-plugin:2.0.5.RELEASE') | |
classpath('gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.13.0') | |
} | |
} | |
apply plugin: 'java' | |
apply plugin: 'eclipse' | |
apply plugin: 'idea' | |
apply plugin: 'org.springframework.boot' | |
apply plugin: 'io.spring.dependency-management' | |
apply plugin: 'com.palantir.docker' | |
group = 'mydocker' | |
bootJar { | |
baseName = 'spring-boot-docker' | |
version = '0.1.0' | |
} | |
task unpack(type: Copy) { | |
dependsOn bootJar | |
from(zipTree(tasks.bootJar.outputs.files.singleFile)) | |
into("build/dependency") | |
} | |
docker { | |
name "${project.group}/${bootJar.baseName}" | |
copySpec.from(tasks.unpack.outputs).into("dependency") | |
buildArgs(['DEPENDENCY': "dependency"]) | |
} | |
repositories { | |
mavenCentral() | |
} | |
sourceCompatibility = 1.8 | |
targetCompatibility = 1.8 | |
dependencies { | |
compile("org.springframework.boot:spring-boot-starter-web") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment