aboutsummaryrefslogtreecommitdiff
path: root/docker/gradle/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'docker/gradle/Dockerfile')
-rw-r--r--docker/gradle/Dockerfile31
1 files changed, 31 insertions, 0 deletions
diff --git a/docker/gradle/Dockerfile b/docker/gradle/Dockerfile
new file mode 100644
index 00000000..938d417e
--- /dev/null
+++ b/docker/gradle/Dockerfile
@@ -0,0 +1,31 @@
+FROM ubuntu:16.04 as downloader
+
+ARG jdk=9
+ADD provision/jdk/java-${jdk}.sh provision/jdk/java-${jdk}.sh
+RUN provision/jdk/java-${jdk}.sh
+
+ARG gradle=4.2.1
+ADD provision/gradle/gradle-${gradle}.sh provision/gradle/gradle-${gradle}.sh
+RUN provision/gradle/gradle-${gradle}.sh
+
+FROM ubuntu:16.04
+
+COPY --from=downloader /opt/gradle/ /opt/gradle/
+COPY --from=downloader /opt/jdk/ /opt/jdk/
+
+RUN update-alternatives --install /usr/bin/java java /opt/jdk/bin/java 1000 && update-alternatives --install /usr/bin/javac javac /opt/jdk/bin/javac 1000 && update-alternatives --install /usr/bin/javadoc javadoc /opt/jdk/bin/javadoc 1000 && update-alternatives --install /usr/bin/javap javap /opt/jdk/bin/javap 1000
+
+WORKDIR workspace
+
+ADD shared/ ./
+ADD gradle/files/ ./
+ARG lombokjar=lombok.jar
+ADD https://projectlombok.org/downloads/${lombokjar} lombok.jar
+
+ARG jdk=9
+ENV JDK_VERSION=${jdk}
+ENV JAVA_HOME=/opt/jdk
+ENV GRADLE_HOME=/opt/gradle/gradle
+ENV PATH="${JAVA_HOME}/bin:${GRADLE_HOME}/bin:${PATH}"
+
+ENTRYPOINT bash