Skip to content

Commit

Permalink
Gradle: Use the docker-remote-api plugin to create a base image to ru…
Browse files Browse the repository at this point in the history
…n ORT

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

[1] GoogleContainerTools/jib#657 (comment)
  • Loading branch information
sschuberth committed Nov 2, 2018
1 parent 6b5a5db commit 5ff9efd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions cli/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
plugins {
id 'com.bmuschko.docker-remote-api'
}

// Apply core plugins.
apply plugin: 'application'

applicationName = 'ort'
mainClassName = 'com.here.ort.Main'

task dockerBuildBaseImage(type: com.bmuschko.gradle.docker.tasks.image.DockerBuildImage) {
description = 'Builds the base Docker image to run ORT.'
// This uses 'docker/Dockerfile'.
tag = 'ort-base:latest'
}

repositories {
jcenter()

Expand Down
1 change: 1 addition & 0 deletions cli/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 5ff9efd

Please sign in to comment.