From b4f29ba829765552239bd18f272fcdaf09eca259 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 21 Jul 2017 10:20:02 -0700 Subject: [PATCH] Add slim variants --- .travis.yml | 8 +++ 6-jdk/Dockerfile | 18 +++++-- 6-jdk/slim/Dockerfile | 69 +++++++++++++++++++++++++ 6-jre/Dockerfile | 18 +++++-- 6-jre/slim/Dockerfile | 69 +++++++++++++++++++++++++ 7-jdk/Dockerfile | 18 +++++-- 7-jdk/alpine/Dockerfile | 14 +++++- 7-jdk/slim/Dockerfile | 69 +++++++++++++++++++++++++ 7-jre/Dockerfile | 18 +++++-- 7-jre/alpine/Dockerfile | 14 +++++- 7-jre/slim/Dockerfile | 69 +++++++++++++++++++++++++ 8-jdk/Dockerfile | 18 +++++-- 8-jdk/alpine/Dockerfile | 14 +++++- 8-jdk/slim/Dockerfile | 77 ++++++++++++++++++++++++++++ 8-jre/Dockerfile | 18 +++++-- 8-jre/alpine/Dockerfile | 14 +++++- 8-jre/slim/Dockerfile | 77 ++++++++++++++++++++++++++++ 9-jdk/Dockerfile | 18 +++++-- 9-jdk/slim/Dockerfile | 71 ++++++++++++++++++++++++++ 9-jre/Dockerfile | 18 +++++-- 9-jre/slim/Dockerfile | 71 ++++++++++++++++++++++++++ generate-stackbrew-library.sh | 2 +- update.sh | 95 ++++++++++++++++++++++------------- 23 files changed, 810 insertions(+), 67 deletions(-) create mode 100644 6-jdk/slim/Dockerfile create mode 100644 6-jre/slim/Dockerfile create mode 100644 7-jdk/slim/Dockerfile create mode 100644 7-jre/slim/Dockerfile create mode 100644 8-jdk/slim/Dockerfile create mode 100644 8-jre/slim/Dockerfile create mode 100644 9-jdk/slim/Dockerfile create mode 100644 9-jre/slim/Dockerfile diff --git a/.travis.yml b/.travis.yml index 5ee2f40d..58d5a7c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,17 +3,25 @@ services: docker env: - VERSION=9-jre + - VERSION=9-jre VARIANT=slim - VERSION=9-jdk + - VERSION=9-jdk VARIANT=slim - VERSION=8-jre + - VERSION=8-jre VARIANT=slim - VERSION=8-jre VARIANT=alpine - VERSION=8-jdk + - VERSION=8-jdk VARIANT=slim - VERSION=8-jdk VARIANT=alpine - VERSION=7-jre + - VERSION=7-jre VARIANT=slim - VERSION=7-jre VARIANT=alpine - VERSION=7-jdk + - VERSION=7-jdk VARIANT=slim - VERSION=7-jdk VARIANT=alpine - VERSION=6-jre + - VERSION=6-jre VARIANT=slim - VERSION=6-jdk + - VERSION=6-jdk VARIANT=slim install: - git clone https://github.com/docker-library/official-images.git ~/official-images diff --git a/6-jdk/Dockerfile b/6-jdk/Dockerfile index 12d9f059..81e91808 100644 --- a/6-jdk/Dockerfile +++ b/6-jdk/Dockerfile @@ -6,10 +6,15 @@ FROM buildpack-deps:wheezy-scm -# A few problems with compiling Java from source: +# A few reasons for installing distribution-provided OpenJDK: +# # 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. +# really hairy. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-6 RUN apt-get update && apt-get install -y --no-install-recommends \ bzip2 \ @@ -39,6 +44,11 @@ ENV JAVA_DEBIAN_VERSION 6b38-1.13.10-1~deb7u1 RUN set -ex; \ \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ apt-get update; \ apt-get install -y \ openjdk-6-jdk="$JAVA_DEBIAN_VERSION" \ @@ -54,4 +64,6 @@ RUN set -ex; \ update-alternatives --query java | grep -q 'Status: manual' # 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! +# improved, please open an issue or a pull request so we can discuss it! +# +# https://github.com/docker-library/openjdk/issues diff --git a/6-jdk/slim/Dockerfile b/6-jdk/slim/Dockerfile new file mode 100644 index 00000000..5064e6ac --- /dev/null +++ b/6-jdk/slim/Dockerfile @@ -0,0 +1,69 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:wheezy-slim + +# A few reasons for installing distribution-provided OpenJDK: +# +# 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. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-6 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + bzip2 \ + unzip \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +# 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'; \ + echo 'set -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 + +# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe +RUN ln -svT "/usr/lib/jvm/java-6-openjdk-$(dpkg --print-architecture)" /docker-java-home +ENV JAVA_HOME /docker-java-home + +ENV JAVA_VERSION 6b38 +ENV JAVA_DEBIAN_VERSION 6b38-1.13.10-1~deb7u1 + +RUN set -ex; \ + \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ + apt-get update; \ + apt-get install -y \ + openjdk-6-jdk="$JAVA_DEBIAN_VERSION" \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# verify that "docker-java-home" returns what we expect + [ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \ + \ +# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java + update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \ +# ... and verify that it actually worked for one of the alternatives we care about + update-alternatives --query java | grep -q 'Status: manual' + +# 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! +# +# https://github.com/docker-library/openjdk/issues diff --git a/6-jre/Dockerfile b/6-jre/Dockerfile index ea250fed..70c70d2e 100644 --- a/6-jre/Dockerfile +++ b/6-jre/Dockerfile @@ -6,10 +6,15 @@ FROM buildpack-deps:wheezy-curl -# A few problems with compiling Java from source: +# A few reasons for installing distribution-provided OpenJDK: +# # 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. +# really hairy. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-6 RUN apt-get update && apt-get install -y --no-install-recommends \ bzip2 \ @@ -39,6 +44,11 @@ ENV JAVA_DEBIAN_VERSION 6b38-1.13.10-1~deb7u1 RUN set -ex; \ \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ apt-get update; \ apt-get install -y \ openjdk-6-jre-headless="$JAVA_DEBIAN_VERSION" \ @@ -54,4 +64,6 @@ RUN set -ex; \ update-alternatives --query java | grep -q 'Status: manual' # 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! +# improved, please open an issue or a pull request so we can discuss it! +# +# https://github.com/docker-library/openjdk/issues diff --git a/6-jre/slim/Dockerfile b/6-jre/slim/Dockerfile new file mode 100644 index 00000000..016aaf20 --- /dev/null +++ b/6-jre/slim/Dockerfile @@ -0,0 +1,69 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:wheezy-slim + +# A few reasons for installing distribution-provided OpenJDK: +# +# 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. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-6 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + bzip2 \ + unzip \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +# 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'; \ + echo 'set -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 + +# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe +RUN ln -svT "/usr/lib/jvm/java-6-openjdk-$(dpkg --print-architecture)" /docker-java-home +ENV JAVA_HOME /docker-java-home/jre + +ENV JAVA_VERSION 6b38 +ENV JAVA_DEBIAN_VERSION 6b38-1.13.10-1~deb7u1 + +RUN set -ex; \ + \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ + apt-get update; \ + apt-get install -y \ + openjdk-6-jre-headless="$JAVA_DEBIAN_VERSION" \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# verify that "docker-java-home" returns what we expect + [ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \ + \ +# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java + update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \ +# ... and verify that it actually worked for one of the alternatives we care about + update-alternatives --query java | grep -q 'Status: manual' + +# 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! +# +# https://github.com/docker-library/openjdk/issues diff --git a/7-jdk/Dockerfile b/7-jdk/Dockerfile index f81e3343..f072648c 100644 --- a/7-jdk/Dockerfile +++ b/7-jdk/Dockerfile @@ -6,10 +6,15 @@ FROM buildpack-deps:jessie-scm -# A few problems with compiling Java from source: +# A few reasons for installing distribution-provided OpenJDK: +# # 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. +# really hairy. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-7 RUN apt-get update && apt-get install -y --no-install-recommends \ bzip2 \ @@ -39,6 +44,11 @@ ENV JAVA_DEBIAN_VERSION 7u131-2.6.9-2~deb8u1 RUN set -ex; \ \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ apt-get update; \ apt-get install -y \ openjdk-7-jdk="$JAVA_DEBIAN_VERSION" \ @@ -54,4 +64,6 @@ RUN set -ex; \ update-alternatives --query java | grep -q 'Status: manual' # 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! +# improved, please open an issue or a pull request so we can discuss it! +# +# https://github.com/docker-library/openjdk/issues diff --git a/7-jdk/alpine/Dockerfile b/7-jdk/alpine/Dockerfile index 2a91ff27..24ff9aa9 100644 --- a/7-jdk/alpine/Dockerfile +++ b/7-jdk/alpine/Dockerfile @@ -6,10 +6,15 @@ FROM alpine:3.6 -# A few problems with compiling Java from source: +# A few reasons for installing distribution-provided OpenJDK: +# # 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. +# really hairy. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-7 # Default to UTF-8 file.encoding ENV LANG C.UTF-8 @@ -33,3 +38,8 @@ RUN set -x \ && apk add --no-cache \ openjdk7="$JAVA_ALPINE_VERSION" \ && [ "$JAVA_HOME" = "$(docker-java-home)" ] + +# 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! +# +# https://github.com/docker-library/openjdk/issues diff --git a/7-jdk/slim/Dockerfile b/7-jdk/slim/Dockerfile new file mode 100644 index 00000000..23f712ce --- /dev/null +++ b/7-jdk/slim/Dockerfile @@ -0,0 +1,69 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:jessie-slim + +# A few reasons for installing distribution-provided OpenJDK: +# +# 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. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-7 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + bzip2 \ + unzip \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +# 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'; \ + echo 'set -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 + +# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe +RUN ln -svT "/usr/lib/jvm/java-7-openjdk-$(dpkg --print-architecture)" /docker-java-home +ENV JAVA_HOME /docker-java-home + +ENV JAVA_VERSION 7u131 +ENV JAVA_DEBIAN_VERSION 7u131-2.6.9-2~deb8u1 + +RUN set -ex; \ + \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ + apt-get update; \ + apt-get install -y \ + openjdk-7-jdk="$JAVA_DEBIAN_VERSION" \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# verify that "docker-java-home" returns what we expect + [ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \ + \ +# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java + update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \ +# ... and verify that it actually worked for one of the alternatives we care about + update-alternatives --query java | grep -q 'Status: manual' + +# 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! +# +# https://github.com/docker-library/openjdk/issues diff --git a/7-jre/Dockerfile b/7-jre/Dockerfile index 26869689..aac48287 100644 --- a/7-jre/Dockerfile +++ b/7-jre/Dockerfile @@ -6,10 +6,15 @@ FROM buildpack-deps:jessie-curl -# A few problems with compiling Java from source: +# A few reasons for installing distribution-provided OpenJDK: +# # 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. +# really hairy. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-7 RUN apt-get update && apt-get install -y --no-install-recommends \ bzip2 \ @@ -39,6 +44,11 @@ ENV JAVA_DEBIAN_VERSION 7u131-2.6.9-2~deb8u1 RUN set -ex; \ \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ apt-get update; \ apt-get install -y \ openjdk-7-jre-headless="$JAVA_DEBIAN_VERSION" \ @@ -54,4 +64,6 @@ RUN set -ex; \ update-alternatives --query java | grep -q 'Status: manual' # 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! +# improved, please open an issue or a pull request so we can discuss it! +# +# https://github.com/docker-library/openjdk/issues diff --git a/7-jre/alpine/Dockerfile b/7-jre/alpine/Dockerfile index 245d5d96..8323c45a 100644 --- a/7-jre/alpine/Dockerfile +++ b/7-jre/alpine/Dockerfile @@ -6,10 +6,15 @@ FROM alpine:3.6 -# A few problems with compiling Java from source: +# A few reasons for installing distribution-provided OpenJDK: +# # 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. +# really hairy. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-7 # Default to UTF-8 file.encoding ENV LANG C.UTF-8 @@ -33,3 +38,8 @@ RUN set -x \ && apk add --no-cache \ openjdk7-jre="$JAVA_ALPINE_VERSION" \ && [ "$JAVA_HOME" = "$(docker-java-home)" ] + +# 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! +# +# https://github.com/docker-library/openjdk/issues diff --git a/7-jre/slim/Dockerfile b/7-jre/slim/Dockerfile new file mode 100644 index 00000000..13478c26 --- /dev/null +++ b/7-jre/slim/Dockerfile @@ -0,0 +1,69 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:jessie-slim + +# A few reasons for installing distribution-provided OpenJDK: +# +# 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. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-7 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + bzip2 \ + unzip \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +# 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'; \ + echo 'set -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 + +# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe +RUN ln -svT "/usr/lib/jvm/java-7-openjdk-$(dpkg --print-architecture)" /docker-java-home +ENV JAVA_HOME /docker-java-home/jre + +ENV JAVA_VERSION 7u131 +ENV JAVA_DEBIAN_VERSION 7u131-2.6.9-2~deb8u1 + +RUN set -ex; \ + \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ + apt-get update; \ + apt-get install -y \ + openjdk-7-jre-headless="$JAVA_DEBIAN_VERSION" \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# verify that "docker-java-home" returns what we expect + [ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \ + \ +# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java + update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \ +# ... and verify that it actually worked for one of the alternatives we care about + update-alternatives --query java | grep -q 'Status: manual' + +# 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! +# +# https://github.com/docker-library/openjdk/issues diff --git a/8-jdk/Dockerfile b/8-jdk/Dockerfile index 1cd58f34..63ab4739 100644 --- a/8-jdk/Dockerfile +++ b/8-jdk/Dockerfile @@ -6,10 +6,15 @@ FROM buildpack-deps:stretch-scm -# A few problems with compiling Java from source: +# A few reasons for installing distribution-provided OpenJDK: +# # 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. +# really hairy. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-8 RUN apt-get update && apt-get install -y --no-install-recommends \ bzip2 \ @@ -43,6 +48,11 @@ ENV CA_CERTIFICATES_JAVA_VERSION 20170531+nmu1 RUN set -ex; \ \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ apt-get update; \ apt-get install -y \ openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \ @@ -62,4 +72,6 @@ RUN set -ex; \ RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure # 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! +# improved, please open an issue or a pull request so we can discuss it! +# +# https://github.com/docker-library/openjdk/issues diff --git a/8-jdk/alpine/Dockerfile b/8-jdk/alpine/Dockerfile index 20a8981a..c2a537bc 100644 --- a/8-jdk/alpine/Dockerfile +++ b/8-jdk/alpine/Dockerfile @@ -6,10 +6,15 @@ FROM alpine:3.6 -# A few problems with compiling Java from source: +# A few reasons for installing distribution-provided OpenJDK: +# # 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. +# really hairy. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-8 # Default to UTF-8 file.encoding ENV LANG C.UTF-8 @@ -33,3 +38,8 @@ RUN set -x \ && apk add --no-cache \ openjdk8="$JAVA_ALPINE_VERSION" \ && [ "$JAVA_HOME" = "$(docker-java-home)" ] + +# 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! +# +# https://github.com/docker-library/openjdk/issues diff --git a/8-jdk/slim/Dockerfile b/8-jdk/slim/Dockerfile new file mode 100644 index 00000000..eb407bf7 --- /dev/null +++ b/8-jdk/slim/Dockerfile @@ -0,0 +1,77 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:stretch-slim + +# A few reasons for installing distribution-provided OpenJDK: +# +# 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. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-8 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + bzip2 \ + unzip \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +# 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'; \ + echo 'set -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 + +# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe +RUN ln -svT "/usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)" /docker-java-home +ENV JAVA_HOME /docker-java-home + +ENV JAVA_VERSION 8u131 +ENV JAVA_DEBIAN_VERSION 8u131-b11-2 + +# see https://bugs.debian.org/775775 +# and https://github.com/docker-library/java/issues/19#issuecomment-70546872 +ENV CA_CERTIFICATES_JAVA_VERSION 20170531+nmu1 + +RUN set -ex; \ + \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ + apt-get update; \ + apt-get install -y \ + openjdk-8-jdk-headless="$JAVA_DEBIAN_VERSION" \ + ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# verify that "docker-java-home" returns what we expect + [ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \ + \ +# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java + update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \ +# ... and verify that it actually worked for one of the alternatives we care about + update-alternatives --query java | grep -q 'Status: manual' + +# see CA_CERTIFICATES_JAVA_VERSION notes above +RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure + +# 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! +# +# https://github.com/docker-library/openjdk/issues diff --git a/8-jre/Dockerfile b/8-jre/Dockerfile index 63aae43f..322ea328 100644 --- a/8-jre/Dockerfile +++ b/8-jre/Dockerfile @@ -6,10 +6,15 @@ FROM buildpack-deps:stretch-curl -# A few problems with compiling Java from source: +# A few reasons for installing distribution-provided OpenJDK: +# # 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. +# really hairy. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-8 RUN apt-get update && apt-get install -y --no-install-recommends \ bzip2 \ @@ -43,6 +48,11 @@ ENV CA_CERTIFICATES_JAVA_VERSION 20170531+nmu1 RUN set -ex; \ \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ apt-get update; \ apt-get install -y \ openjdk-8-jre-headless="$JAVA_DEBIAN_VERSION" \ @@ -62,4 +72,6 @@ RUN set -ex; \ RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure # 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! +# improved, please open an issue or a pull request so we can discuss it! +# +# https://github.com/docker-library/openjdk/issues diff --git a/8-jre/alpine/Dockerfile b/8-jre/alpine/Dockerfile index b41aeb62..189029a7 100644 --- a/8-jre/alpine/Dockerfile +++ b/8-jre/alpine/Dockerfile @@ -6,10 +6,15 @@ FROM alpine:3.6 -# A few problems with compiling Java from source: +# A few reasons for installing distribution-provided OpenJDK: +# # 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. +# really hairy. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-8 # Default to UTF-8 file.encoding ENV LANG C.UTF-8 @@ -33,3 +38,8 @@ RUN set -x \ && apk add --no-cache \ openjdk8-jre="$JAVA_ALPINE_VERSION" \ && [ "$JAVA_HOME" = "$(docker-java-home)" ] + +# 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! +# +# https://github.com/docker-library/openjdk/issues diff --git a/8-jre/slim/Dockerfile b/8-jre/slim/Dockerfile new file mode 100644 index 00000000..78fbd1eb --- /dev/null +++ b/8-jre/slim/Dockerfile @@ -0,0 +1,77 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:stretch-slim + +# A few reasons for installing distribution-provided OpenJDK: +# +# 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. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-8 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + bzip2 \ + unzip \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +# 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'; \ + echo 'set -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 + +# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe +RUN ln -svT "/usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)" /docker-java-home +ENV JAVA_HOME /docker-java-home/jre + +ENV JAVA_VERSION 8u131 +ENV JAVA_DEBIAN_VERSION 8u131-b11-2 + +# see https://bugs.debian.org/775775 +# and https://github.com/docker-library/java/issues/19#issuecomment-70546872 +ENV CA_CERTIFICATES_JAVA_VERSION 20170531+nmu1 + +RUN set -ex; \ + \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ + apt-get update; \ + apt-get install -y \ + openjdk-8-jre-headless="$JAVA_DEBIAN_VERSION" \ + ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# verify that "docker-java-home" returns what we expect + [ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \ + \ +# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java + update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \ +# ... and verify that it actually worked for one of the alternatives we care about + update-alternatives --query java | grep -q 'Status: manual' + +# see CA_CERTIFICATES_JAVA_VERSION notes above +RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure + +# 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! +# +# https://github.com/docker-library/openjdk/issues diff --git a/9-jdk/Dockerfile b/9-jdk/Dockerfile index 60a91e20..ed2b5a4e 100644 --- a/9-jdk/Dockerfile +++ b/9-jdk/Dockerfile @@ -6,10 +6,15 @@ FROM buildpack-deps:sid-scm -# A few problems with compiling Java from source: +# A few reasons for installing distribution-provided OpenJDK: +# # 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. +# really hairy. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-9 RUN apt-get update && apt-get install -y --no-install-recommends \ bzip2 \ @@ -41,6 +46,11 @@ ENV JAVA_DEBIAN_VERSION 9~b177-3 RUN set -ex; \ \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ apt-get update; \ apt-get install -y \ openjdk-9-jdk-headless="$JAVA_DEBIAN_VERSION" \ @@ -56,4 +66,6 @@ RUN set -ex; \ update-alternatives --query java | grep -q 'Status: manual' # 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! +# improved, please open an issue or a pull request so we can discuss it! +# +# https://github.com/docker-library/openjdk/issues diff --git a/9-jdk/slim/Dockerfile b/9-jdk/slim/Dockerfile new file mode 100644 index 00000000..949e9938 --- /dev/null +++ b/9-jdk/slim/Dockerfile @@ -0,0 +1,71 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:sid-slim + +# A few reasons for installing distribution-provided OpenJDK: +# +# 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. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-9 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + bzip2 \ + unzip \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +RUN echo 'deb http://deb.debian.org/debian experimental main' > /etc/apt/sources.list.d/experimental.list + +# 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'; \ + echo 'set -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 + +# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe +RUN ln -svT "/usr/lib/jvm/java-9-openjdk-$(dpkg --print-architecture)" /docker-java-home +ENV JAVA_HOME /docker-java-home + +ENV JAVA_VERSION 9-b177 +ENV JAVA_DEBIAN_VERSION 9~b177-3 + +RUN set -ex; \ + \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ + apt-get update; \ + apt-get install -y \ + openjdk-9-jdk-headless="$JAVA_DEBIAN_VERSION" \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# verify that "docker-java-home" returns what we expect + [ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \ + \ +# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java + update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \ +# ... and verify that it actually worked for one of the alternatives we care about + update-alternatives --query java | grep -q 'Status: manual' + +# 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! +# +# https://github.com/docker-library/openjdk/issues diff --git a/9-jre/Dockerfile b/9-jre/Dockerfile index be01d7c9..e7f296fa 100644 --- a/9-jre/Dockerfile +++ b/9-jre/Dockerfile @@ -6,10 +6,15 @@ FROM buildpack-deps:sid-curl -# A few problems with compiling Java from source: +# A few reasons for installing distribution-provided OpenJDK: +# # 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. +# really hairy. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-9 RUN apt-get update && apt-get install -y --no-install-recommends \ bzip2 \ @@ -41,6 +46,11 @@ ENV JAVA_DEBIAN_VERSION 9~b177-3 RUN set -ex; \ \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ apt-get update; \ apt-get install -y \ openjdk-9-jre-headless="$JAVA_DEBIAN_VERSION" \ @@ -56,4 +66,6 @@ RUN set -ex; \ update-alternatives --query java | grep -q 'Status: manual' # 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! +# improved, please open an issue or a pull request so we can discuss it! +# +# https://github.com/docker-library/openjdk/issues diff --git a/9-jre/slim/Dockerfile b/9-jre/slim/Dockerfile new file mode 100644 index 00000000..716da493 --- /dev/null +++ b/9-jre/slim/Dockerfile @@ -0,0 +1,71 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:sid-slim + +# A few reasons for installing distribution-provided OpenJDK: +# +# 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. +# +# For some sample build times, see Debian's buildd logs: +# https://buildd.debian.org/status/logs.php?pkg=openjdk-9 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + bzip2 \ + unzip \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +RUN echo 'deb http://deb.debian.org/debian experimental main' > /etc/apt/sources.list.d/experimental.list + +# 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'; \ + echo 'set -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 + +# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe +RUN ln -svT "/usr/lib/jvm/java-9-openjdk-$(dpkg --print-architecture)" /docker-java-home +ENV JAVA_HOME /docker-java-home + +ENV JAVA_VERSION 9-b177 +ENV JAVA_DEBIAN_VERSION 9~b177-3 + +RUN set -ex; \ + \ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \ + mkdir -p /usr/share/man/man1; \ + fi; \ + \ + apt-get update; \ + apt-get install -y \ + openjdk-9-jre-headless="$JAVA_DEBIAN_VERSION" \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ +# verify that "docker-java-home" returns what we expect + [ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \ + \ +# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java + update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \ +# ... and verify that it actually worked for one of the alternatives we care about + update-alternatives --query java | grep -q 'Status: manual' + +# 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! +# +# https://github.com/docker-library/openjdk/issues diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index b58546e1..5a46f711 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -130,7 +130,7 @@ for version in "${versions[@]}"; do EOE for v in \ - alpine \ + slim alpine \ windows/windowsservercore windows/nanoserver \ ; do dir="$version/$v" diff --git a/update.sh b/update.sh index ddb72e0e..765bcb4d 100755 --- a/update.sh +++ b/update.sh @@ -108,7 +108,32 @@ debian-latest-version() { echo "$latestVersion" } -java-home-script() { +template-generated-warning() { + local from="$1"; shift + local javaVersion="$1"; shift + + cat <<-EOD + # + # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" + # + # PLEASE DO NOT EDIT IT DIRECTLY. + # + + FROM $from + + # A few reasons for installing distribution-provided OpenJDK: + # + # 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. + # + # For some sample build times, see Debian's buildd logs: + # https://buildd.debian.org/status/logs.php?pkg=openjdk-$javaVersion + EOD +} + +template-java-home-script() { cat <<'EOD' # add a simple script that can auto-detect the appropriate JAVA_HOME value @@ -123,6 +148,16 @@ RUN { \ EOD } +template-contribute-footer() { + cat <<-'EOD' + + # 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! + # + # https://github.com/docker-library/openjdk/issues + EOD +} + travisEnv= appveyorEnv= for version in "${versions[@]}"; do @@ -155,20 +190,7 @@ for version in "${versions[@]}"; do echo "$version: $fullVersion (debian $debianVersion)" - cat > "$version/Dockerfile" <<-EOD - # - # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" - # - # PLEASE DO NOT EDIT IT DIRECTLY. - # - - FROM buildpack-deps:$suite-$buildpackDepsVariant - - # 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. - EOD + template-generated-warning "buildpack-deps:$suite-$buildpackDepsVariant" "$javaVersion" > "$version/Dockerfile" cat >> "$version/Dockerfile" <<'EOD' @@ -192,7 +214,7 @@ EOD ENV LANG C.UTF-8 EOD - java-home-script >> "$version/Dockerfile" + template-java-home-script >> "$version/Dockerfile" jreSuffix= if [ "$javaType" = 'jre' -a "$javaVersion" -lt 9 ]; then @@ -224,6 +246,11 @@ EOD RUN set -ex; \\ \\ +# deal with slim variants not having man page directories (which causes "update-alternatives" to fail) + if [ ! -d /usr/share/man/man1 ]; then \\ + mkdir -p /usr/share/man/man1; \\ + fi; \\ + \\ apt-get update; \\ apt-get install -y \\ $debianPackage="\$JAVA_DEBIAN_VERSION" \\ @@ -254,11 +281,7 @@ EOD EOD fi - cat >> "$version/Dockerfile" <<-EOD - - # 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! - EOD + template-contribute-footer >> "$version/Dockerfile" if [ -d "$version/alpine" ]; then alpineVersion="${alpineVersions[$javaVersion]}" @@ -286,25 +309,15 @@ EOD echo "$version: $alpineFullVersion (alpine $alpinePackageVersion)" - cat > "$version/alpine/Dockerfile" <<-EOD - # - # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" - # - # PLEASE DO NOT EDIT IT DIRECTLY. - # + template-generated-warning "alpine:$alpineVersion" "$javaVersion" > "$version/alpine/Dockerfile" - FROM alpine:$alpineVersion - - # 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. + cat >> "$version/alpine/Dockerfile" <<-'EOD' # Default to UTF-8 file.encoding ENV LANG C.UTF-8 EOD - java-home-script >> "$version/alpine/Dockerfile" + template-java-home-script >> "$version/alpine/Dockerfile" cat >> "$version/alpine/Dockerfile" <<-EOD ENV JAVA_HOME $alpineJavaHome @@ -323,9 +336,23 @@ RUN set -x \\ && [ "\$JAVA_HOME" = "\$(docker-java-home)" ] EOD + template-contribute-footer >> "$version/alpine/Dockerfile" + travisEnv='\n - VERSION='"$version"' VARIANT=alpine'"$travisEnv" fi + if [ -d "$version/slim" ]; then + # for the "slim" variants, + # - swap "buildpack-deps:SUITE-xxx" for "debian:SUITE-slim" + # - swap "openjdk-N-(jre|jdk) for the -headless versions, where available (openjdk-8+ only for JDK variants) + sed -r \ + -e 's!^FROM buildpack-deps:([^-]+)(-.+)?!FROM debian:\1-slim!' \ + -e 's!(openjdk-(\d+-jre|([89]\d*|\d\d+)-jdk))=!\1-headless=!g' \ + "$version/Dockerfile" > "$version/slim/Dockerfile" + + travisEnv='\n - VERSION='"$version"' VARIANT=slim'"$travisEnv" + fi + if [ -d "$version/windows" ]; then ojdkbuildVersion="$( git ls-remote --tags 'https://github.com/ojdkbuild/ojdkbuild' \