Skip to content

Commit

Permalink
Include JDK 9 in the dev tools image
Browse files Browse the repository at this point in the history
  • Loading branch information
luontola committed Dec 27, 2017
1 parent 6039108 commit 04c3533
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
4 changes: 3 additions & 1 deletion BUILDING.md
Expand Up @@ -31,7 +31,9 @@ Using the Docker-based Development Environment
To avoid having to install all the Java versions on your computer, there is a
Docker image for building Retrolambda.

The image is already in Docker Hub, but it can also be built locally with:
The image is already in Docker Hub, but it can also be built locally with the
following command. But first you need to download the JDK 5 and 9 installers
into the `dev/installers` directory and install [Rocker](https://github.com/grammarly/rocker).

make

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -11,7 +11,7 @@ current_path := $(dir $(mkfile_path))

# Builds the development docker file
docker-build:
docker build --tag=$(TAG) ./dev
rocker build --var Tag=$(TAG) --file dev/Rockerfile

# Clean this docker image
docker-clean:
Expand Down
20 changes: 13 additions & 7 deletions dev/Dockerfile → dev/Rockerfile
@@ -1,21 +1,26 @@
FROM centos:7

# Install all supported JDK versions
RUN curl -L --header "Cookie: oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/1.5.0_22/jdk-1_5_0_22-linux-amd64-rpm.bin \
-o jdk-1_5_0_22-linux-amd64-rpm.bin \
# Install JDK 5
MOUNT installers:/installers
RUN cd /installers \
&& chmod u+x jdk-1_5_0_22-linux-amd64-rpm.bin \
&& echo yes | ./jdk-1_5_0_22-linux-amd64-rpm.bin \
&& rm -v jdk-1_5_0_22-linux-amd64* \
&& yum -y install \
&& echo yes | ./jdk-1_5_0_22-linux-amd64-rpm.bin

# Install JDK 6, 7, 8
RUN yum -y install \
java-1.6.0-openjdk-devel \
java-1.7.0-openjdk-devel \
java-1.8.0-openjdk-devel \
&& yum clean all

# Install JDK 9
RUN rpm -Uvh /installers/jdk-9.0.1_linux-x64_bin.rpm

ENV JAVA5_HOME=/usr/java/jdk1.5.0_22
ENV JAVA6_HOME=/usr/lib/jvm/java-1.6.0
ENV JAVA7_HOME=/usr/lib/jvm/java-1.7.0
ENV JAVA8_HOME=/usr/lib/jvm/java-1.8.0
ENV JAVA9_HOME=/usr/java/jdk-9.0.1
ENV JAVA_HOME=$JAVA8_HOME

# Install Maven
Expand All @@ -29,3 +34,4 @@ COPY toolchains.xml /root/.m2/

RUN mkdir /project
WORKDIR /project
TAG {{ .Tag }}
2 changes: 2 additions & 0 deletions dev/installers/.gitignore
@@ -0,0 +1,2 @@
*
!.gitignore

0 comments on commit 04c3533

Please sign in to comment.