aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/.dockerignore1
-rw-r--r--docker/gradle/Dockerfile29
-rw-r--r--docker/gradle/files/build.gradle5
-rw-r--r--docker/maven/Dockerfile29
-rw-r--r--docker/maven/files/pom.xml53
-rw-r--r--docker/readme.txt8
-rw-r--r--docker/shared/lombok.config4
-rw-r--r--docker/shared/src/main/java/HelloWorld.java13
8 files changed, 142 insertions, 0 deletions
diff --git a/docker/.dockerignore b/docker/.dockerignore
new file mode 100644
index 00000000..0d79d56d
--- /dev/null
+++ b/docker/.dockerignore
@@ -0,0 +1 @@
+readme.txt \ No newline at end of file
diff --git a/docker/gradle/Dockerfile b/docker/gradle/Dockerfile
new file mode 100644
index 00000000..73d5fa1b
--- /dev/null
+++ b/docker/gradle/Dockerfile
@@ -0,0 +1,29 @@
+FROM ubuntu:16.04 as downloader
+
+RUN apt-get update && apt-get install wget -y
+RUN wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.tar.gz -O jdk9_linux-x64_bin.tar.gz
+RUN tar -xzf jdk9_linux-x64_bin.tar.gz -C /opt/
+
+RUN wget https://services.gradle.org/distributions/gradle-4.2.1-bin.zip -O gradle.zip
+RUN apt-get update && apt-get install unzip -y
+RUN mkdir /opt/gradle && unzip -d /opt/gradle gradle.zip
+
+FROM ubuntu:16.04
+
+COPY --from=downloader /opt/gradle/ /opt/gradle/
+COPY --from=downloader /opt/jdk-9.0.1/ /opt/jdk-9.0.1/
+
+RUN update-alternatives --install /usr/bin/java java /opt/jdk-9.0.1/bin/java 1000 && update-alternatives --install /usr/bin/javac javac /opt/jdk-9.0.1/bin/javac 1000 && update-alternatives --install /usr/bin/javadoc javadoc /opt/jdk-9.0.1/bin/javadoc 1000 && update-alternatives --install /usr/bin/javap javap /opt/jdk-9.0.1/bin/javap 1000
+
+WORKDIR workspace
+
+ADD shared/ ./
+ADD gradle/files/ ./
+ARG lombokjar=lombok.jar
+ADD https://projectlombok.org/downloads/${lombokjar} lombok.jar
+
+ENV JAVA_HOME=/opt/jdk-9.0.1
+ENV GRADLE_HOME=/opt/gradle/gradle-4.2.1
+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/maven/Dockerfile b/docker/maven/Dockerfile
new file mode 100644
index 00000000..a41932c9
--- /dev/null
+++ b/docker/maven/Dockerfile
@@ -0,0 +1,29 @@
+FROM ubuntu:16.04 as downloader
+
+RUN apt-get update && apt-get install wget -y
+RUN wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.tar.gz -O jdk9_linux-x64_bin.tar.gz
+RUN tar -xzf jdk9_linux-x64_bin.tar.gz -C /opt/
+
+RUN wget http://www-us.apache.org/dist/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz -O maven.tar.gz
+RUN mkdir /usr/local/apache-maven/ && tar xvf maven.tar.gz -C /usr/local/apache-maven/
+
+FROM ubuntu:16.04
+
+COPY --from=downloader /usr/local/apache-maven/ /usr/local/apache-maven/
+COPY --from=downloader /opt/jdk-9.0.1/ /opt/jdk-9.0.1/
+
+RUN update-alternatives --install /usr/bin/java java /opt/jdk-9.0.1/bin/java 1000 && update-alternatives --install /usr/bin/javac javac /opt/jdk-9.0.1/bin/javac 1000 && update-alternatives --install /usr/bin/javadoc javadoc /opt/jdk-9.0.1/bin/javadoc 1000 && update-alternatives --install /usr/bin/javap javap /opt/jdk-9.0.1/bin/javap 1000
+
+WORKDIR workspace
+
+ADD shared/ ./
+ADD maven/files/ ./
+ARG lombokjar=lombok.jar
+ADD https://projectlombok.org/downloads/${lombokjar} lombok.jar
+
+ENV JAVA_HOME=/opt/jdk-9.0.1
+ENV M2_HOME=/usr/local/apache-maven/apache-maven-3.5.0
+ENV M2=${M2_HOME}/bin
+ENV PATH="${M2}:${JAVA_HOME}/bin:${PATH}"
+
+ENTRYPOINT bash
diff --git a/docker/maven/files/pom.xml b/docker/maven/files/pom.xml
new file mode 100644
index 00000000..9ecd8868
--- /dev/null
+++ b/docker/maven/files/pom.xml
@@ -0,0 +1,53 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>com.example</groupId>
+ <artifactId>lombok-jdk9</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <java.version>1.9</java.version>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.7.0</version>
+ <configuration>
+ <source>${java.version}</source>
+ <target>${java.version}</target>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <fork>true</fork>
+ <compilerargs>
+ <arg>-Werror</arg>
+ <arg>-Xlint:all</arg>
+ <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
+ <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
+ <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
+ <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
+ <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
+ <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
+ <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
+ <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
+ <arg>-J--add-opens=-Jjdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
+ </compilerargs>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <version>1.2.3</version>
+ <scope>system</scope>
+ <systemPath>/workspace/lombok.jar</systemPath>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/docker/readme.txt b/docker/readme.txt
new file mode 100644
index 00000000..d60f2f05
--- /dev/null
+++ b/docker/readme.txt
@@ -0,0 +1,8 @@
+ARG lombokjar=lombok.jar
+
+Example build commands:
+
+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 .
+
diff --git a/docker/shared/lombok.config b/docker/shared/lombok.config
new file mode 100644
index 00000000..62f16b08
--- /dev/null
+++ b/docker/shared/lombok.config
@@ -0,0 +1,4 @@
+lombok.addJavaxGeneratedAnnotation = false
+lombok.anyConstructor.suppressConstructorProperties = true
+
+config.stopBubbling = true \ No newline at end of file
diff --git a/docker/shared/src/main/java/HelloWorld.java b/docker/shared/src/main/java/HelloWorld.java
new file mode 100644
index 00000000..f4c30218
--- /dev/null
+++ b/docker/shared/src/main/java/HelloWorld.java
@@ -0,0 +1,13 @@
+@lombok.Data
+public class HelloWorld {
+ private final int answer;
+
+ public static void main(String... args) {
+ System.out.println(new HelloWorld(42).getAnswer());
+ }
+
+ @FunctionalInterface
+ interface Foo {
+ String name();
+ }
+}