Skip to content

Commit

Permalink
Gradle: Use the docker-remote-api plugin to create an image for runni…
Browse files Browse the repository at this point in the history
…ng ORT

In constract to JIB [1], this plugin can build a base image from a
Dockerfile.

[1] GoogleContainerTools/jib#657 (comment)
  • Loading branch information
sschuberth committed Nov 2, 2018
1 parent 6b5a5db commit f864ab4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ plugins {

id 'com.github.ben-manes.versions' apply false
id 'io.gitlab.arturbosch.detekt' apply false

id 'com.bmuschko.docker-remote-api'
}

task buildDockerBaseImage(type: com.bmuschko.gradle.docker.tasks.image.DockerBuildImage) {
// This uses 'docker/Dockerfile'.
tag = 'ort-base:latest'
}

subprojects {
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM openjdk:jre-alpine
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
detektPluginVersion = 1.0.0.RC9.2
dockerRemoteApiPluginVersion = 4.0.3
dokkaPluginVersion = 0.9.16
kotlinPluginVersion = 1.3.0
versionsPluginVersion = 0.20.0
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ pluginManagement {
eachPlugin {
// Work around https://github.com/gradle/gradle/issues/1697.
if (requested.version == null) {
def idName = requested.id.name.split('-').collect { it.capitalize() }.join().uncapitalize()
def versionPropertyName = (requested.id.id == 'org.jetbrains.kotlin.jvm') ?
"kotlinPluginVersion" : "${requested.id.name}PluginVersion"
"kotlinPluginVersion" : "${idName}PluginVersion"
logger.info("Checking for plugin version property '$versionPropertyName'.")
if (gradle.rootProject.hasProperty(versionPropertyName)) {
def version = gradle.rootProject.properties[versionPropertyName]
Expand Down

0 comments on commit f864ab4

Please sign in to comment.