Com.palantir.docker: Difference between revisions
Jump to navigation
Jump to search
Line 39: | Line 39: | ||
... | ... | ||
apply plugin: 'com.palantir.docker' | apply plugin: 'com.palantir.docker' | ||
... | ... | ||
Line 48: | Line 46: | ||
docker { | docker { | ||
dependsOn build | |||
name "com.example/playground/${bootJar.archiveBaseName}" | |||
files bootJar.archiveFile | |||
buildArgs(['JAR_FILE': "${bootJar.archiveBaseName}"]) | |||
} | } | ||
</syntaxhighlight> | |||
The corresponding Dockerfile: | |||
<syntaxhighlight lang='text'> | |||
FROM openjdk:8-jdk-alpine | |||
ARG JAR_FILE | |||
COPY ${JAR_FILE} app.jar | |||
RUN apk --no-cache add curl bash bind-tools | |||
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 08:28, 6 February 2019
External
Internal
Overview
Latest Version
Example
buildscript {
ext {
...
dockerGradleVersion = '0.20.1'
}
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
...
classpath("gradle.plugin.com.palantir.gradle.docker:gradle-docker:${dockerGradleVersion}")
}
}
...
apply plugin: 'com.palantir.docker'
...
docker {
dependsOn build
name "com.example/playground/${bootJar.archiveBaseName}"
files bootJar.archiveFile
buildArgs(['JAR_FILE': "${bootJar.archiveBaseName}"])
}
The corresponding Dockerfile:
FROM openjdk:8-jdk-alpine
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
RUN apk --no-cache add curl bash bind-tools
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]