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 constrast to JIB [1], this plugin can build (base) images from a
Dockerfile. The base image uses a slim / "headless" JRE 11 running on Debian
"sid" (unstable) and is otherwise empty for now.

[1] GoogleContainerTools/jib#657 (comment)

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Dec 14, 2018
1 parent fc762ce commit 8d0c554
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
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) {
// This task uses 'docker/Dockerfile' as the input file.
description = 'Builds the base Docker image to run ORT.'
tag = 'ort-base:latest'
}

repositories {
jcenter()

Expand Down
18 changes: 18 additions & 0 deletions cli/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2017-2018 HERE Europe B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# License-Filename: LICENSE

FROM openjdk:11-jre-slim-sid
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-RC12
dockerRemoteApiPluginVersion = 4.1.0
dokkaPluginVersion = 0.9.17
ideaExtPluginVersion = 0.4.2
kotlinPluginVersion = 1.3.11
Expand Down

0 comments on commit 8d0c554

Please sign in to comment.