Skip to content

Commit

Permalink
[docker] add jdk-17 and change line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
rspilker committed Sep 14, 2023
1 parent 000ce6d commit f1fc676
Show file tree
Hide file tree
Showing 13 changed files with 219 additions and 108 deletions.
8 changes: 4 additions & 4 deletions docker/ant/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:20.04 as downloader
FROM ubuntu:22.04 as downloader

ARG jdk=16
ARG jdk=17
ADD provision/jdk/java-${jdk}.sh provision/jdk/java-${jdk}.sh
RUN provision/jdk/java-${jdk}.sh

Expand All @@ -11,7 +11,7 @@ ARG ant=1.10.9
ADD provision/ant/ant-${ant}.sh provision/ant/ant-${ant}.sh
RUN provision/ant/ant-${ant}.sh

FROM ubuntu:20.04
FROM ubuntu:22.04

COPY --from=downloader /usr/local/apache-ant/ /usr/local/apache-ant/
COPY --from=downloader /opt/jdk/ /opt/jdk/
Expand All @@ -22,7 +22,7 @@ WORKDIR workspace

ADD shared/ ./

ARG jdk=16
ARG jdk=17
ADD ant/files/jdk-${jdk} ./

COPY --from=downloader /lombok.jar /workspace/classpath/lombok.jar
Expand Down
35 changes: 35 additions & 0 deletions docker/ant/files/jdk-17/classpath/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<project name="example" default="dist" basedir=".">
<property name="src" location="src/main/java"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="build.sysclasspath" value="ignore"/>

<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
</target>

<target name="compile" depends="init" description="compile the source">
<javac classpath="lombok.jar" modulepath="lombok.jar" srcdir="${src}" destdir="${build}" fork="true">
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/>
</javac>
</target>

<target name="dist" depends="compile" description="generate the distribution">
<mkdir dir="${dist}/lib"/>
<jar jarfile="${dist}/lib/example-${DSTAMP}.jar" basedir="${build}"/>
</target>

<target name="clean" description="clean up">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>
35 changes: 35 additions & 0 deletions docker/ant/files/jdk-17/modules/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<project name="example" default="dist" basedir=".">
<property name="src" location="src/main/java"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="build.sysclasspath" value="ignore"/>

<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
</target>

<target name="compile" depends="init" description="compile the source">
<javac classpath="lombok.jar" srcdir="${src}" destdir="${build}" fork="true">
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/>
</javac>
</target>

<target name="dist" depends="compile" description="generate the distribution">
<mkdir dir="${dist}/lib"/>
<jar jarfile="${dist}/lib/example-${DSTAMP}.jar" basedir="${build}"/>
</target>

<target name="clean" description="clean up">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>
8 changes: 4 additions & 4 deletions docker/ant/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ The ant version to be used. Supported values:
(To be executed from the `<lombokhome>/docker` directory)

```
docker build -t lombok-ant-jdk16 -f ant/Dockerfile .
docker build -t lombok-ant-jdk17 -f ant/Dockerfile .
docker build -t lombok-ant-jdk16 --build-arg lombokjar=lombok-1.18.20.jar -f ant/Dockerfile .
docker build -t lombok-ant-jdk17 --build-arg lombokjar=lombok-1.18.20.jar -f ant/Dockerfile .
```

## Example run commands:

```
docker run -it lombok-ant-jdk16
docker run -it lombok-ant-jdk17
docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-ant-jdk16
docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-ant-jdk17
```

## Example container commands:
Expand Down
8 changes: 4 additions & 4 deletions docker/bazel/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:18.04 as downloader
FROM ubuntu:22.04 as downloader

ARG jdk=16
ARG jdk=17
ADD provision/jdk/java-${jdk}.sh provision/jdk/java-${jdk}.sh
RUN provision/jdk/java-${jdk}.sh

Expand All @@ -11,7 +11,7 @@ ARG bazel=2.0.0
ADD provision/bazel/bazel-${bazel}.sh provision/bazel/bazel-${bazel}.sh
RUN provision/bazel/bazel-${bazel}.sh

FROM ubuntu:18.04
FROM ubuntu:22.04

COPY --from=downloader /opt/bazel/ /opt/bazel/
COPY --from=downloader /opt/jdk/ /opt/jdk/
Expand All @@ -27,7 +27,7 @@ ADD bazel/files/ ./
COPY --from=downloader /lombok.jar /workspace/classpath/lombok.jar
COPY --from=downloader /lombok.jar /workspace/modules/lombok.jar

ARG jdk=16
ARG jdk=17
ENV JDK_VERSION=${jdk}
ENV JAVA_HOME=/opt/jdk
ENV BAZEL_HOME=/opt/bazel
Expand Down
8 changes: 4 additions & 4 deletions docker/bazel/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ The bazel version to be used. Supported values:
(To be executed from the `<lombokhome>/docker` directory)

```
docker build -t lombok-bazel-jdk13 -f bazel/Dockerfile .
docker build -t lombok-bazel-jdk17 -f bazel/Dockerfile .
docker build -t lombok-bazel-jdk13 --build-arg lombokjar=lombok-1.16.20.jar -f bazel/Dockerfile .
docker build -t lombok-bazel-jdk17 --build-arg lombokjar=lombok-1.16.20.jar -f bazel/Dockerfile .
```

## Example run commands:

```
docker run -it lombok-bazel-jdk13
docker run -it lombok-bazel-jdk17
docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-bazel-jdk13
docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-bazel-jdk17
```

## Example container commands:
Expand Down
70 changes: 35 additions & 35 deletions docker/gradle/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
FROM ubuntu:20.04 as downloader

ARG jdk=16
ADD provision/jdk/java-${jdk}.sh provision/jdk/java-${jdk}.sh
RUN provision/jdk/java-${jdk}.sh

ARG lombokjar=lombok.jar
ADD https://projectlombok.org/downloads/${lombokjar} /lombok.jar

ARG gradle=7.6.1
ADD provision/gradle/gradle-${gradle}.sh provision/gradle/gradle-${gradle}.sh
RUN provision/gradle/gradle-${gradle}.sh

FROM ubuntu:20.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/ ./

COPY --from=downloader /lombok.jar /workspace/classpath/lombok.jar
COPY --from=downloader /lombok.jar /workspace/modules/lombok.jar

ARG jdk=16
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
FROM ubuntu:22.04 as downloader

ARG jdk=17
ADD provision/jdk/java-${jdk}.sh provision/jdk/java-${jdk}.sh
RUN provision/jdk/java-${jdk}.sh

ARG lombokjar=lombok.jar
ADD https://projectlombok.org/downloads/${lombokjar} /lombok.jar

ARG gradle=7.6.1
ADD provision/gradle/gradle-${gradle}.sh provision/gradle/gradle-${gradle}.sh
RUN provision/gradle/gradle-${gradle}.sh

FROM ubuntu:22.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/ ./

COPY --from=downloader /lombok.jar /workspace/classpath/lombok.jar
COPY --from=downloader /lombok.jar /workspace/modules/lombok.jar

ARG jdk=17
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
8 changes: 4 additions & 4 deletions docker/gradle/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ The gradle version to be used. Supported values:
(To be executed from the `<lombokhome>/docker` directory)

```
docker build -t lombok-gradle-jdk16 -f gradle/Dockerfile .
docker build -t lombok-gradle-jdk17 -f gradle/Dockerfile .
docker build -t lombok-gradle-jdk16 --build-arg lombokjar=lombok-1.18.20.jar -f gradle/Dockerfile .
docker build -t lombok-gradle-jdk17 --build-arg lombokjar=lombok-1.18.20.jar -f gradle/Dockerfile .
```

## Example run commands:

```
docker run -it lombok-gradle-jdk16
docker run -it lombok-gradle-jdk17
docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/classpath/lombok.jar lombok-gradle-jdk16
docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/classpath/lombok.jar lombok-gradle-jdk17
```

## Example container commands:
Expand Down
74 changes: 37 additions & 37 deletions docker/maven/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
FROM ubuntu:20.04 as downloader

ARG jdk=16
ADD provision/jdk/java-${jdk}.sh provision/jdk/java-${jdk}.sh
RUN provision/jdk/java-${jdk}.sh

ARG lombokjar=lombok.jar
ADD https://projectlombok.org/downloads/${lombokjar} /lombok.jar

ARG maven=3.6.3
ADD provision/maven/maven-${maven}.sh provision/maven/maven-${maven}.sh
RUN provision/maven/maven-${maven}.sh

FROM ubuntu:20.04

COPY --from=downloader /usr/local/apache-maven/ /usr/local/apache-maven/
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/ ./

ARG jdk=16
ADD maven/files/jdk-${jdk} ./

COPY --from=downloader /lombok.jar /workspace/classpath/lombok.jar
COPY --from=downloader /lombok.jar /workspace/modules/lombok.jar

ENV JDK_VERSION=${jdk}
ENV JAVA_HOME=/opt/jdk
ENV M2_HOME=/usr/local/apache-maven/apache-maven
ENV M2=${M2_HOME}/bin
ENV PATH="${M2}:${JAVA_HOME}/bin:${PATH}"

ENTRYPOINT bash
FROM ubuntu:22.04 as downloader

ARG jdk=17
ADD provision/jdk/java-${jdk}.sh provision/jdk/java-${jdk}.sh
RUN provision/jdk/java-${jdk}.sh

ARG lombokjar=lombok.jar
ADD https://projectlombok.org/downloads/${lombokjar} /lombok.jar

ARG maven=3.6.3
ADD provision/maven/maven-${maven}.sh provision/maven/maven-${maven}.sh
RUN provision/maven/maven-${maven}.sh

FROM ubuntu:22.04

COPY --from=downloader /usr/local/apache-maven/ /usr/local/apache-maven/
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/ ./

ARG jdk=17
ADD maven/files/jdk-${jdk} ./

COPY --from=downloader /lombok.jar /workspace/classpath/lombok.jar
COPY --from=downloader /lombok.jar /workspace/modules/lombok.jar

ENV JDK_VERSION=${jdk}
ENV JAVA_HOME=/opt/jdk
ENV M2_HOME=/usr/local/apache-maven/apache-maven
ENV M2=${M2_HOME}/bin
ENV PATH="${M2}:${JAVA_HOME}/bin:${PATH}"

ENTRYPOINT bash
37 changes: 37 additions & 0 deletions docker/maven/Dockerfile.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM ubuntu:22.04 as downloader

ARG jdk=17
ADD provision/jdk/java-${jdk}.sh provision/jdk/java-${jdk}.sh
RUN provision/jdk/java-${jdk}.sh

ARG lombokjar=lombok.jar
ADD https://projectlombok.org/downloads/${lombokjar} /lombok.jar

ARG maven=3.6.3
ADD provision/maven/maven-${maven}.sh provision/maven/maven-${maven}.sh
RUN provision/maven/maven-${maven}.sh

FROM ubuntu:22.04

COPY --from=downloader /usr/local/apache-maven/ /usr/local/apache-maven/
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/ ./

ARG jdk=16
ADD maven/files/jdk-${jdk} ./

COPY --from=downloader /lombok.jar /workspace/classpath/lombok.jar
COPY --from=downloader /lombok.jar /workspace/modules/lombok.jar

ENV JDK_VERSION=${jdk}
ENV JAVA_HOME=/opt/jdk
ENV M2_HOME=/usr/local/apache-maven/apache-maven
ENV M2=${M2_HOME}/bin
ENV PATH="${M2}:${JAVA_HOME}/bin:${PATH}"

ENTRYPOINT bash
8 changes: 4 additions & 4 deletions docker/maven/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ The maven version to be used. Supported values:
(To be executed from the `<lombokhome>/docker` directory)

```
docker build -t lombok-maven-jdk16 -f maven/Dockerfile .
docker build -t lombok-maven-jdk17 -f maven/Dockerfile .
docker build -t lombok-maven-jdk16 --build-arg lombokjar=lombok-1.18.20.jar -f maven/Dockerfile .
docker build -t lombok-maven-jdk17 --build-arg lombokjar=lombok-1.18.20.jar -f maven/Dockerfile .
```

## Example run commands:

```
docker run -it lombok-maven-jdk16
docker run -it lombok-maven-jdk17
docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-maven-jdk16
docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-maven-jdk17
```

## Example container commands:
Expand Down
Loading

0 comments on commit f1fc676

Please sign in to comment.