aboutsummaryrefslogtreecommitdiff
path: root/docker/gradle
diff options
context:
space:
mode:
Diffstat (limited to 'docker/gradle')
-rw-r--r--docker/gradle/Dockerfile31
-rw-r--r--docker/gradle/files/build.gradle5
-rw-r--r--docker/gradle/readme.md33
3 files changed, 69 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
diff --git a/docker/gradle/files/build.gradle b/docker/gradle/files/build.gradle
new file mode 100644
index 00000000..49923f04
--- /dev/null
+++ b/docker/gradle/files/build.gradle
@@ -0,0 +1,5 @@
+apply plugin: 'java'
+
+dependencies {
+ compileOnly files('lombok.jar')
+} \ No newline at end of file
diff --git a/docker/gradle/readme.md b/docker/gradle/readme.md
new file mode 100644
index 00000000..efe4f237
--- /dev/null
+++ b/docker/gradle/readme.md
@@ -0,0 +1,33 @@
+## Configuration
+
+[_(general configuration and options)_](../readme.md)
+
+### `ARG gradle=4.2.1`
+
+The gradle version to be used. Supported values:
+
+- `4.2.1` (default)
+
+## Example build commands:
+
+(To be executed from the `<lombokhome>/docker` directory)
+
+```
+docker build -t lombok-gradle-jdk9 -f gradle/Dockerfile .
+
+docker build -t lombok-gradle-jdk9 --build-arg lombokjar=lombok-1.16.18.jar -f gradle/Dockerfile .
+```
+
+## Example run commands:
+
+```
+docker run -it lombok-gradle-jdk9
+
+docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-gradle-jdk9
+```
+
+## Example container commands:
+
+```
+gradle assemble
+```