diff --git a/.travis.yml b/.travis.yml index 8f900bbf..22a2e83f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,8 @@ services: docker env: - VERSION=openjdk-9-jre - VERSION=openjdk-9-jdk + - VERSION=openjdk-8-jre VARIANT=alpine + - VERSION=openjdk-8-jdk VARIANT=alpine - VERSION=openjdk-8-jre - VERSION=openjdk-8-jdk - VERSION=openjdk-7-jre @@ -16,8 +18,8 @@ install: before_script: - env | sort - - cd "$VERSION" - - image="java:$VERSION" + - cd "${VERSION}${VARIANT:+/$VARIANT}" + - image="java:${VERSION}${VARIANT:+-$VARIANT}" script: - docker build -t "$image" . diff --git a/openjdk-8-jdk/alpine/Dockerfile b/openjdk-8-jdk/alpine/Dockerfile new file mode 100644 index 00000000..884fda25 --- /dev/null +++ b/openjdk-8-jdk/alpine/Dockerfile @@ -0,0 +1,29 @@ +FROM alpine:3.3 + +# A few problems with compiling Java from source: +# 1. Oracle. Licensing prevents us from redistributing the official JDK. +# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets +# really hairy. + +# Default to UTF-8 file.encoding +ENV LANG C.UTF-8 + +# add a simple script that can auto-detect the appropriate JAVA_HOME value +# based on whether the JDK or only the JRE is installed +RUN { \ + echo '#!/bin/sh -e'; \ + echo; \ + echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \ + } > /usr/local/bin/docker-java-home \ + && chmod +x /usr/local/bin/docker-java-home + +ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk + +ENV JAVA_VERSION 8u72 +ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/bin + +RUN set -x \ + && apk add --no-cache \ + "openjdk8>=${JAVA_VERSION/u/.}" \ + ca-certificates \ + && [ "$JAVA_HOME" = "$(docker-java-home)" ] diff --git a/openjdk-8-jre/alpine/Dockerfile b/openjdk-8-jre/alpine/Dockerfile new file mode 100644 index 00000000..21c5b6dd --- /dev/null +++ b/openjdk-8-jre/alpine/Dockerfile @@ -0,0 +1,28 @@ +FROM alpine:3.3 + +# A few problems with compiling Java from source: +# 1. Oracle. Licensing prevents us from redistributing the official JDK. +# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets +# really hairy. + +# Default to UTF-8 file.encoding +ENV LANG C.UTF-8 + +# add a simple script that can auto-detect the appropriate JAVA_HOME value +# based on whether the JDK or only the JRE is installed +RUN { \ + echo '#!/bin/sh -e'; \ + echo; \ + echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \ + } > /usr/local/bin/docker-java-home \ + && chmod +x /usr/local/bin/docker-java-home + +ENV JAVA_VERSION 8u72 +ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk/jre + +RUN set -x \ + && apk add --no-cache \ + "openjdk8>=${JAVA_VERSION/u/.}" \ + ca-certificates \ + && [ "$JAVA_HOME" = "$(docker-java-home)" ] +