diff --git a/.travis.yml b/.travis.yml index 92d7a298..10246dc5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,8 @@ language: bash sudo: 9000 env: + - VERSION=openjdk-9-jre + - VERSION=openjdk-9-jdk - VERSION=openjdk-8-jre - VERSION=openjdk-8-jdk - VERSION=openjdk-7-jre diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index c1bc693d..015e6dee 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -31,7 +31,9 @@ for version in "${versions[@]}"; do if [ "${fullVersion%-*}" != "$fullVersion" ]; then bases+=( $flavor-${fullVersion%-*} ) # like "8u40-b09 fi - bases+=( $flavor-$javaVersion ) + if [ "$javaVersion" != "${fullVersion%-*}" ]; then + bases+=( $flavor-$javaVersion ) + fi if [ "$flavor" = "$defaultFlavor" ]; then for base in "${bases[@]}"; do bases+=( "${base#$flavor-}" ) diff --git a/openjdk-9-jdk/Dockerfile b/openjdk-9-jdk/Dockerfile new file mode 100644 index 00000000..47b5fc9e --- /dev/null +++ b/openjdk-9-jdk/Dockerfile @@ -0,0 +1,37 @@ +FROM buildpack-deps:sid-curl + +# 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. + +RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/* + +RUN echo 'deb http://httpredir.debian.org/debian experimental main' > /etc/apt/sources.list.d/experimental.list + +# Default to UTF-8 file.encoding +ENV LANG C.UTF-8 + +ENV JAVA_VERSION 9~b88 +ENV JAVA_DEBIAN_VERSION 9~b88-1 + +# see https://bugs.debian.org/775775 +# and https://github.com/docker-library/java/issues/19#issuecomment-70546872 +ENV CA_CERTIFICATES_JAVA_VERSION 20140324 + +RUN set -x \ + && apt-get update \ + && apt-get install -y \ + openjdk-9-jdk="$JAVA_DEBIAN_VERSION" \ + ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \ + && rm -rf /var/lib/apt/lists/* + +# see CA_CERTIFICATES_JAVA_VERSION notes above +RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure + +# see https://bugs.debian.org/793210 +# and https://github.com/docker-library/java/issues/46#issuecomment-119026586 +RUN apt-get update && apt-get install -y --no-install-recommends libfontconfig1 && rm -rf /var/lib/apt/lists/* + +# If you're reading this and have any feedback on how this image could be +# improved, please open an issue or a pull request so we can discuss it! diff --git a/openjdk-9-jre/Dockerfile b/openjdk-9-jre/Dockerfile new file mode 100644 index 00000000..8598e5a8 --- /dev/null +++ b/openjdk-9-jre/Dockerfile @@ -0,0 +1,37 @@ +FROM buildpack-deps:sid-curl + +# 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. + +RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/* + +RUN echo 'deb http://httpredir.debian.org/debian experimental main' > /etc/apt/sources.list.d/experimental.list + +# Default to UTF-8 file.encoding +ENV LANG C.UTF-8 + +ENV JAVA_VERSION 9~b88 +ENV JAVA_DEBIAN_VERSION 9~b88-1 + +# see https://bugs.debian.org/775775 +# and https://github.com/docker-library/java/issues/19#issuecomment-70546872 +ENV CA_CERTIFICATES_JAVA_VERSION 20140324 + +RUN set -x \ + && apt-get update \ + && apt-get install -y \ + openjdk-9-jre-headless="$JAVA_DEBIAN_VERSION" \ + ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \ + && rm -rf /var/lib/apt/lists/* + +# see CA_CERTIFICATES_JAVA_VERSION notes above +RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure + +# see https://bugs.debian.org/793210 +# and https://github.com/docker-library/java/issues/46#issuecomment-119026586 +RUN apt-get update && apt-get install -y --no-install-recommends libfontconfig1 && rm -rf /var/lib/apt/lists/* + +# If you're reading this and have any feedback on how this image could be +# improved, please open an issue or a pull request so we can discuss it! diff --git a/update.sh b/update.sh index f5185113..f046a70c 100755 --- a/update.sh +++ b/update.sh @@ -24,10 +24,15 @@ for version in "${versions[@]}"; do dist+="-backports" fi + # we don't have buildpack-deps:experimental-* so we use sid and add a source + if grep -q experimental "$version/Dockerfile"; then + dist="${dist%:sid}:experimental" + fi + fullVersion= case "$flavor" in openjdk) - debianVersion="$(set -x; docker run --rm "$dist" bash -c "apt-get update &> /dev/null && apt-cache show $flavor-$javaVersion-$javaType | grep '^Version: ' | head -1 | cut -d' ' -f2")" + debianVersion="$(set -x; docker run --rm "$dist" bash -c "apt-get update -qq && apt-cache show $flavor-$javaVersion-$javaType | awk -F ': ' '\$1 == \"Version\" { print \$2; exit }'")" fullVersion="${debianVersion%%-*}" ;; esac