You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by dz...@apache.org on 2021/09/17 08:53:35 UTC

[drill] 01/09: Base Docker image on maven:3.8.2-jdk-11 and openjdk-11.

This is an automated email from the ASF dual-hosted git repository.

dzamo pushed a commit to branch 7999-docker-jdk
in repository https://gitbox.apache.org/repos/asf/drill.git

commit 060087e87c1f3e78a4b06115e8aebb2c165a102a
Author: James Turton <ja...@somecomputer.xyz>
AuthorDate: Thu Sep 2 12:05:42 2021 +0200

    Base Docker image on maven:3.8.2-jdk-11 and openjdk-11.
---
 .dockerignore |  8 ++++++++
 Dockerfile    | 16 +++++++++++-----
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..4ce0e46
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,8 @@
+.dockerignore
+Dockerfile
+.git
+
+# The top-level Dockerfile does its own Maven build so we don't want
+# distribution/target.  See distribution/Dockerfile for a Dockerfile that
+# builds an image using binaries copied from distribution/target.
+distribution/target
diff --git a/Dockerfile b/Dockerfile
index cfe3a2d..5a2f884 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,19 +16,25 @@
 # limitations under the License.
 #
 
-# This Dockerfile is used for automated builds in DockerHub. It adds project sources into the build image, builds
-# Drill and copies built binaries into the target image based on openjdk:8u232-jdk image.
+# This Dockerfile is used for automated builds in DockerHub. It adds
+# project sources into the build image, builds Drill and copies built
+# binaries into the target image based on openjdk:11 image.
 
 # Uses intermediate image for building Drill to reduce target image size
-FROM maven:3.6.3-jdk-8 as build
+FROM maven:3.8.2-jdk-11 as build
 
 # Copy project sources into the container
 COPY . /src
 
 WORKDIR /src
 
+# Fetch Drill build deps in a separate layer from the build so that they are
+# cached even if the Maven build fails.  Fetch up to 4 dependencies in 
+# parallel.
+RUN mvn -Dmaven.artifact.threads=4 dependency:resolve
+
 # Builds Drill
-RUN  mvn clean install -DskipTests -q
+RUN  mvn -T1C clean install -DskipTests -q
 
 # Get project version and copy built binaries into /opt/drill directory
 RUN VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) \
@@ -36,7 +42,7 @@ RUN VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --n
  && mv distribution/target/apache-drill-${VERSION}/apache-drill-${VERSION}/* /opt/drill
 
 # Target image
-FROM openjdk:8u232-jdk
+FROM openjdk:11
 
 RUN mkdir /opt/drill