From 73109a04a88588688834bd991e2f2b212de837e1 Mon Sep 17 00:00:00 2001 From: George Adams Date: Wed, 25 Oct 2023 23:19:57 +0100 Subject: [PATCH] further dockerfile refactor enhancements --- 11/jdk/alpine/Dockerfile | 19 ++++++++--- 11/jdk/centos/Dockerfile | 22 ++++++------ 11/jdk/ubi/ubi9-minimal/Dockerfile | 15 +++++++- 11/jdk/ubuntu/focal/Dockerfile | 20 +++++------ 11/jdk/ubuntu/jammy/Dockerfile | 20 +++++------ 11/jdk/windows/nanoserver-1809/Dockerfile | 8 ++--- 11/jdk/windows/nanoserver-ltsc2022/Dockerfile | 8 ++--- 11/jre/alpine/Dockerfile | 19 ++++++++--- 11/jre/centos/Dockerfile | 22 ++++++------ 11/jre/ubi/ubi9-minimal/Dockerfile | 15 +++++++- 11/jre/ubuntu/focal/Dockerfile | 20 +++++------ 11/jre/ubuntu/jammy/Dockerfile | 20 +++++------ 11/jre/windows/nanoserver-1809/Dockerfile | 6 ++-- 11/jre/windows/nanoserver-ltsc2022/Dockerfile | 6 ++-- 17/jdk/alpine/Dockerfile | 22 +++++++++--- 17/jdk/centos/Dockerfile | 28 +++++++-------- 17/jdk/ubi/ubi9-minimal/Dockerfile | 15 +++++++- 17/jdk/ubuntu/focal/Dockerfile | 26 +++++++------- 17/jdk/ubuntu/jammy/Dockerfile | 26 +++++++------- 17/jdk/windows/nanoserver-1809/Dockerfile | 12 +++---- 17/jdk/windows/nanoserver-ltsc2022/Dockerfile | 12 +++---- .../windows/windowsservercore-1809/Dockerfile | 2 +- .../windowsservercore-ltsc2022/Dockerfile | 2 +- 17/jre/alpine/Dockerfile | 22 +++++++++--- 17/jre/centos/Dockerfile | 28 +++++++-------- 17/jre/ubi/ubi9-minimal/Dockerfile | 15 +++++++- 17/jre/ubuntu/focal/Dockerfile | 26 +++++++------- 17/jre/ubuntu/jammy/Dockerfile | 26 +++++++------- 17/jre/windows/nanoserver-1809/Dockerfile | 10 +++--- 17/jre/windows/nanoserver-ltsc2022/Dockerfile | 10 +++--- .../windows/windowsservercore-1809/Dockerfile | 2 +- .../windowsservercore-ltsc2022/Dockerfile | 2 +- 21/jdk/alpine/Dockerfile | 22 +++++++++--- 21/jdk/ubi/ubi9-minimal/Dockerfile | 15 +++++++- 21/jdk/ubuntu/jammy/Dockerfile | 26 +++++++------- 21/jdk/windows/nanoserver-1809/Dockerfile | 8 ++--- 21/jdk/windows/nanoserver-ltsc2022/Dockerfile | 8 ++--- 21/jre/alpine/Dockerfile | 22 +++++++++--- 21/jre/ubi/ubi9-minimal/Dockerfile | 15 +++++++- 21/jre/ubuntu/jammy/Dockerfile | 26 +++++++------- 21/jre/windows/nanoserver-1809/Dockerfile | 6 ++-- 21/jre/windows/nanoserver-ltsc2022/Dockerfile | 6 ++-- 8/jdk/alpine/Dockerfile | 19 ++++++++--- 8/jdk/centos/Dockerfile | 22 ++++++------ 8/jdk/ubi/ubi9-minimal/Dockerfile | 15 +++++++- 8/jdk/ubuntu/focal/Dockerfile | 20 +++++------ 8/jdk/ubuntu/jammy/Dockerfile | 20 +++++------ 8/jdk/windows/nanoserver-1809/Dockerfile | 8 ++--- 8/jdk/windows/nanoserver-ltsc2022/Dockerfile | 8 ++--- 8/jre/alpine/Dockerfile | 19 ++++++++--- 8/jre/centos/Dockerfile | 22 ++++++------ 8/jre/ubi/ubi9-minimal/Dockerfile | 15 +++++++- 8/jre/ubuntu/focal/Dockerfile | 20 +++++------ 8/jre/ubuntu/jammy/Dockerfile | 20 +++++------ 8/jre/windows/nanoserver-1809/Dockerfile | 6 ++-- 8/jre/windows/nanoserver-ltsc2022/Dockerfile | 6 ++-- docker_templates/alpine-linux.Dockerfile.j2 | 22 ++++++++---- docker_templates/centos.Dockerfile.j2 | 34 ++++++++----------- docker_templates/nanoserver.Dockerfile.j2 | 7 +++- docker_templates/partials/arch-variable.j2 | 7 ++++ docker_templates/partials/binutils.j2 | 5 +++ .../partials/multi-arch-install.j2 | 2 ++ .../partials/version-check-windows.j2 | 11 ++---- docker_templates/partials/version-check.j2 | 6 ++-- docker_templates/ubi9-minimal.Dockerfile.j2 | 17 ++++++++-- docker_templates/ubuntu.Dockerfile.j2 | 32 +++++++---------- generate_dockerfiles.py | 9 ++++- 67 files changed, 632 insertions(+), 400 deletions(-) create mode 100644 docker_templates/partials/arch-variable.j2 create mode 100644 docker_templates/partials/binutils.j2 diff --git a/11/jdk/alpine/Dockerfile b/11/jdk/alpine/Dockerfile index 104bd8e1c..5ba0a2df4 100644 --- a/11/jdk/alpine/Dockerfile +++ b/11/jdk/alpine/Dockerfile @@ -26,10 +26,21 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - # fontconfig and ttf-dejavu added to support serverside image generation by Java programs - # java-cacerts added to support adding CA certificates to the Java keystore - # bash is required for the entrypoint script (see https://github.com/adoptium/containers/issues/415) - apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib; \ + apk add --no-cache \ + # bash is required for the entrypoint script + # see https://github.com/adoptium/containers/issues/415 + bash \ + # fontconfig and ttf-dejavu added to support serverside image generation by Java programs + fontconfig ttf-dejavu \ + # java-cacerts added to support adding CA certificates to the Java keystore + java-cacerts \ + # fixes issues with apk del apk-tools + # see https://github.com/adoptium/containers/issues/136 + libretls zlib \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + musl-locales musl-locales-lang \ + tzdata \ + ; \ rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk-11.0.21+9 diff --git a/11/jdk/centos/Dockerfile b/11/jdk/centos/Dockerfile index ef5d357bc..2a7da4f90 100644 --- a/11/jdk/centos/Dockerfile +++ b/11/jdk/centos/Dockerfile @@ -27,17 +27,17 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ yum install -y \ - gzip \ - tar \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - tzdata \ - openssl \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates \ - fontconfig \ + gzip \ + tar \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + tzdata \ + openssl \ + # utilities for keeping Centos and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + fontconfig \ ; \ rm -rf /var/cache/yum diff --git a/11/jdk/ubi/ubi9-minimal/Dockerfile b/11/jdk/ubi/ubi9-minimal/Dockerfile index 0ad81f47c..5b7783862 100644 --- a/11/jdk/ubi/ubi9-minimal/Dockerfile +++ b/11/jdk/ubi/ubi9-minimal/Dockerfile @@ -26,7 +26,20 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf install -y \ + gzip \ + tar \ + # Required for objdump and also jlink + binutils \ + tzdata \ + openssl \ + wget \ + # utilities for keeping UBI and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + fontconfig \ + glibc-langpack-en \ + ; \ microdnf clean all ENV JAVA_VERSION jdk-11.0.21+9 diff --git a/11/jdk/ubuntu/focal/Dockerfile b/11/jdk/ubuntu/focal/Dockerfile index 532f0f4a9..5e19dddba 100644 --- a/11/jdk/ubuntu/focal/Dockerfile +++ b/11/jdk/ubuntu/focal/Dockerfile @@ -28,16 +28,16 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/11/jdk/ubuntu/jammy/Dockerfile b/11/jdk/ubuntu/jammy/Dockerfile index 6d98c9663..768b8cb0b 100644 --- a/11/jdk/ubuntu/jammy/Dockerfile +++ b/11/jdk/ubuntu/jammy/Dockerfile @@ -28,16 +28,16 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/11/jdk/windows/nanoserver-1809/Dockerfile b/11/jdk/windows/nanoserver-1809/Dockerfile index 39ff4ee50..06c4f8251 100644 --- a/11/jdk/windows/nanoserver-1809/Dockerfile +++ b/11/jdk/windows/nanoserver-1809/Dockerfile @@ -33,9 +33,9 @@ USER ContainerUser COPY --from=eclipse-temurin:11.0.21_9-jdk-windowsservercore-1809 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "javac --version"; javac --version; \ - echo "java --version"; java --version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo javac --version && javac --version \ + && echo java --version && java --version \ + && echo Complete. CMD ["jshell"] diff --git a/11/jdk/windows/nanoserver-ltsc2022/Dockerfile b/11/jdk/windows/nanoserver-ltsc2022/Dockerfile index d96bd01b4..a5d681f7f 100644 --- a/11/jdk/windows/nanoserver-ltsc2022/Dockerfile +++ b/11/jdk/windows/nanoserver-ltsc2022/Dockerfile @@ -33,9 +33,9 @@ USER ContainerUser COPY --from=eclipse-temurin:11.0.21_9-jdk-windowsservercore-ltsc2022 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "javac --version"; javac --version; \ - echo "java --version"; java --version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo javac --version && javac --version \ + && echo java --version && java --version \ + && echo Complete. CMD ["jshell"] diff --git a/11/jre/alpine/Dockerfile b/11/jre/alpine/Dockerfile index 3514b88d3..5c68ea3da 100644 --- a/11/jre/alpine/Dockerfile +++ b/11/jre/alpine/Dockerfile @@ -26,10 +26,21 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - # fontconfig and ttf-dejavu added to support serverside image generation by Java programs - # java-cacerts added to support adding CA certificates to the Java keystore - # bash is required for the entrypoint script (see https://github.com/adoptium/containers/issues/415) - apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib; \ + apk add --no-cache \ + # bash is required for the entrypoint script + # see https://github.com/adoptium/containers/issues/415 + bash \ + # fontconfig and ttf-dejavu added to support serverside image generation by Java programs + fontconfig ttf-dejavu \ + # java-cacerts added to support adding CA certificates to the Java keystore + java-cacerts \ + # fixes issues with apk del apk-tools + # see https://github.com/adoptium/containers/issues/136 + libretls zlib \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + musl-locales musl-locales-lang \ + tzdata \ + ; \ rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk-11.0.21+9 diff --git a/11/jre/centos/Dockerfile b/11/jre/centos/Dockerfile index acd7281ef..587b7b4e4 100644 --- a/11/jre/centos/Dockerfile +++ b/11/jre/centos/Dockerfile @@ -27,17 +27,17 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ yum install -y \ - gzip \ - tar \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - tzdata \ - openssl \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates \ - fontconfig \ + gzip \ + tar \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + tzdata \ + openssl \ + # utilities for keeping Centos and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + fontconfig \ ; \ rm -rf /var/cache/yum diff --git a/11/jre/ubi/ubi9-minimal/Dockerfile b/11/jre/ubi/ubi9-minimal/Dockerfile index ce128d397..c4e035009 100644 --- a/11/jre/ubi/ubi9-minimal/Dockerfile +++ b/11/jre/ubi/ubi9-minimal/Dockerfile @@ -26,7 +26,20 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf install -y \ + gzip \ + tar \ + # Required for objdump and also jlink + binutils \ + tzdata \ + openssl \ + wget \ + # utilities for keeping UBI and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + fontconfig \ + glibc-langpack-en \ + ; \ microdnf clean all ENV JAVA_VERSION jdk-11.0.21+9 diff --git a/11/jre/ubuntu/focal/Dockerfile b/11/jre/ubuntu/focal/Dockerfile index 482093695..ea4368ec9 100644 --- a/11/jre/ubuntu/focal/Dockerfile +++ b/11/jre/ubuntu/focal/Dockerfile @@ -28,16 +28,16 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/11/jre/ubuntu/jammy/Dockerfile b/11/jre/ubuntu/jammy/Dockerfile index 730a5cc2e..edb289fdb 100644 --- a/11/jre/ubuntu/jammy/Dockerfile +++ b/11/jre/ubuntu/jammy/Dockerfile @@ -28,16 +28,16 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/11/jre/windows/nanoserver-1809/Dockerfile b/11/jre/windows/nanoserver-1809/Dockerfile index b36948ed6..889cdb7e8 100644 --- a/11/jre/windows/nanoserver-1809/Dockerfile +++ b/11/jre/windows/nanoserver-1809/Dockerfile @@ -33,6 +33,6 @@ USER ContainerUser COPY --from=eclipse-temurin:11.0.21_9-jre-windowsservercore-1809 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "java --version"; java --version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo java --version && java --version \ + && echo Complete. diff --git a/11/jre/windows/nanoserver-ltsc2022/Dockerfile b/11/jre/windows/nanoserver-ltsc2022/Dockerfile index 3e2733b59..fd7a68b53 100644 --- a/11/jre/windows/nanoserver-ltsc2022/Dockerfile +++ b/11/jre/windows/nanoserver-ltsc2022/Dockerfile @@ -33,6 +33,6 @@ USER ContainerUser COPY --from=eclipse-temurin:11.0.21_9-jre-windowsservercore-ltsc2022 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "java --version"; java --version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo java --version && java --version \ + && echo Complete. diff --git a/17/jdk/alpine/Dockerfile b/17/jdk/alpine/Dockerfile index ab320406e..558a8bd69 100644 --- a/17/jdk/alpine/Dockerfile +++ b/17/jdk/alpine/Dockerfile @@ -26,10 +26,24 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - # fontconfig and ttf-dejavu added to support serverside image generation by Java programs - # java-cacerts added to support adding CA certificates to the Java keystore - # bash is required for the entrypoint script (see https://github.com/adoptium/containers/issues/415) - apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib; \ + apk add --no-cache \ + # bash is required for the entrypoint script + # see https://github.com/adoptium/containers/issues/415 + bash \ + # fontconfig and ttf-dejavu added to support serverside image generation by Java programs + fontconfig ttf-dejavu \ + # java-cacerts added to support adding CA certificates to the Java keystore + java-cacerts \ + # fixes issues with apk del apk-tools + # see https://github.com/adoptium/containers/issues/136 + libretls zlib \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + musl-locales musl-locales-lang \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + ; \ rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk-17.0.9+9 diff --git a/17/jdk/centos/Dockerfile b/17/jdk/centos/Dockerfile index 18718902b..e2ee1630b 100644 --- a/17/jdk/centos/Dockerfile +++ b/17/jdk/centos/Dockerfile @@ -27,20 +27,20 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ yum install -y \ - gzip \ - tar \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - tzdata \ - openssl \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates \ - fontconfig \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ + gzip \ + tar \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + tzdata \ + openssl \ + # utilities for keeping Centos and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + fontconfig \ ; \ rm -rf /var/cache/yum diff --git a/17/jdk/ubi/ubi9-minimal/Dockerfile b/17/jdk/ubi/ubi9-minimal/Dockerfile index df8662b44..d89da570b 100644 --- a/17/jdk/ubi/ubi9-minimal/Dockerfile +++ b/17/jdk/ubi/ubi9-minimal/Dockerfile @@ -26,7 +26,20 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf install -y \ + gzip \ + tar \ + # Required for objdump and also jlink + binutils \ + tzdata \ + openssl \ + wget \ + # utilities for keeping UBI and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + fontconfig \ + glibc-langpack-en \ + ; \ microdnf clean all ENV JAVA_VERSION jdk-17.0.9+9 diff --git a/17/jdk/ubuntu/focal/Dockerfile b/17/jdk/ubuntu/focal/Dockerfile index 04c6db80a..0803e02ce 100644 --- a/17/jdk/ubuntu/focal/Dockerfile +++ b/17/jdk/ubuntu/focal/Dockerfile @@ -28,19 +28,19 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/17/jdk/ubuntu/jammy/Dockerfile b/17/jdk/ubuntu/jammy/Dockerfile index 0a5117a39..381969c72 100644 --- a/17/jdk/ubuntu/jammy/Dockerfile +++ b/17/jdk/ubuntu/jammy/Dockerfile @@ -28,19 +28,19 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/17/jdk/windows/nanoserver-1809/Dockerfile b/17/jdk/windows/nanoserver-1809/Dockerfile index c9d1472de..c935d566b 100644 --- a/17/jdk/windows/nanoserver-1809/Dockerfile +++ b/17/jdk/windows/nanoserver-1809/Dockerfile @@ -21,7 +21,7 @@ FROM mcr.microsoft.com/windows/nanoserver:1809 SHELL ["cmd", "/s", "/c"] -ENV JAVA_VERSION jdk-17.0.9+9.1 +ENV JAVA_VERSION jdk-17.0.9+9 ENV JAVA_HOME C:\\openjdk-17 # "ERROR: Access to the registry path is denied." @@ -31,11 +31,11 @@ RUN echo Updating PATH: %JAVA_HOME%\bin;%PATH% \ && echo Complete. USER ContainerUser -COPY --from=eclipse-temurin:17.0.9_9.1-jdk-windowsservercore-1809 $JAVA_HOME $JAVA_HOME +COPY --from=eclipse-temurin:17.0.9_9-jdk-windowsservercore-1809 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "javac --version"; javac --version; \ - echo "java --version"; java --version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo javac --version && javac --version \ + && echo java --version && java --version \ + && echo Complete. CMD ["jshell"] diff --git a/17/jdk/windows/nanoserver-ltsc2022/Dockerfile b/17/jdk/windows/nanoserver-ltsc2022/Dockerfile index 12a9c966a..6d26c5163 100644 --- a/17/jdk/windows/nanoserver-ltsc2022/Dockerfile +++ b/17/jdk/windows/nanoserver-ltsc2022/Dockerfile @@ -21,7 +21,7 @@ FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 SHELL ["cmd", "/s", "/c"] -ENV JAVA_VERSION jdk-17.0.9+9.1 +ENV JAVA_VERSION jdk-17.0.9+9 ENV JAVA_HOME C:\\openjdk-17 # "ERROR: Access to the registry path is denied." @@ -31,11 +31,11 @@ RUN echo Updating PATH: %JAVA_HOME%\bin;%PATH% \ && echo Complete. USER ContainerUser -COPY --from=eclipse-temurin:17.0.9_9.1-jdk-windowsservercore-ltsc2022 $JAVA_HOME $JAVA_HOME +COPY --from=eclipse-temurin:17.0.9_9-jdk-windowsservercore-ltsc2022 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "javac --version"; javac --version; \ - echo "java --version"; java --version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo javac --version && javac --version \ + && echo java --version && java --version \ + && echo Complete. CMD ["jshell"] diff --git a/17/jdk/windows/windowsservercore-1809/Dockerfile b/17/jdk/windows/windowsservercore-1809/Dockerfile index 774c89d01..72a9a7b0c 100644 --- a/17/jdk/windows/windowsservercore-1809/Dockerfile +++ b/17/jdk/windows/windowsservercore-1809/Dockerfile @@ -22,7 +22,7 @@ FROM mcr.microsoft.com/windows/servercore:1809 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-17.0.9+9.1 +ENV JAVA_VERSION jdk-17.0.9+9 RUN Write-Host ('Downloading https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9.1/OpenJDK17U-jdk_x64_windows_hotspot_17.0.9_9.msi ...'); \ curl.exe -LfsSo openjdk.msi https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9.1/OpenJDK17U-jdk_x64_windows_hotspot_17.0.9_9.msi ; \ diff --git a/17/jdk/windows/windowsservercore-ltsc2022/Dockerfile b/17/jdk/windows/windowsservercore-ltsc2022/Dockerfile index 6983393d7..a93e79368 100644 --- a/17/jdk/windows/windowsservercore-ltsc2022/Dockerfile +++ b/17/jdk/windows/windowsservercore-ltsc2022/Dockerfile @@ -22,7 +22,7 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-17.0.9+9.1 +ENV JAVA_VERSION jdk-17.0.9+9 RUN Write-Host ('Downloading https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9.1/OpenJDK17U-jdk_x64_windows_hotspot_17.0.9_9.msi ...'); \ curl.exe -LfsSo openjdk.msi https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9.1/OpenJDK17U-jdk_x64_windows_hotspot_17.0.9_9.msi ; \ diff --git a/17/jre/alpine/Dockerfile b/17/jre/alpine/Dockerfile index e9555ca2f..ded028d10 100644 --- a/17/jre/alpine/Dockerfile +++ b/17/jre/alpine/Dockerfile @@ -26,10 +26,24 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - # fontconfig and ttf-dejavu added to support serverside image generation by Java programs - # java-cacerts added to support adding CA certificates to the Java keystore - # bash is required for the entrypoint script (see https://github.com/adoptium/containers/issues/415) - apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib; \ + apk add --no-cache \ + # bash is required for the entrypoint script + # see https://github.com/adoptium/containers/issues/415 + bash \ + # fontconfig and ttf-dejavu added to support serverside image generation by Java programs + fontconfig ttf-dejavu \ + # java-cacerts added to support adding CA certificates to the Java keystore + java-cacerts \ + # fixes issues with apk del apk-tools + # see https://github.com/adoptium/containers/issues/136 + libretls zlib \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + musl-locales musl-locales-lang \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + ; \ rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk-17.0.9+9 diff --git a/17/jre/centos/Dockerfile b/17/jre/centos/Dockerfile index 5558ee836..4a351d6c2 100644 --- a/17/jre/centos/Dockerfile +++ b/17/jre/centos/Dockerfile @@ -27,20 +27,20 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ yum install -y \ - gzip \ - tar \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - tzdata \ - openssl \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates \ - fontconfig \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ + gzip \ + tar \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + tzdata \ + openssl \ + # utilities for keeping Centos and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + fontconfig \ ; \ rm -rf /var/cache/yum diff --git a/17/jre/ubi/ubi9-minimal/Dockerfile b/17/jre/ubi/ubi9-minimal/Dockerfile index 5eb70ce50..a8659f4b0 100644 --- a/17/jre/ubi/ubi9-minimal/Dockerfile +++ b/17/jre/ubi/ubi9-minimal/Dockerfile @@ -26,7 +26,20 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf install -y \ + gzip \ + tar \ + # Required for objdump and also jlink + binutils \ + tzdata \ + openssl \ + wget \ + # utilities for keeping UBI and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + fontconfig \ + glibc-langpack-en \ + ; \ microdnf clean all ENV JAVA_VERSION jdk-17.0.9+9 diff --git a/17/jre/ubuntu/focal/Dockerfile b/17/jre/ubuntu/focal/Dockerfile index 49f7395b1..a3be3da88 100644 --- a/17/jre/ubuntu/focal/Dockerfile +++ b/17/jre/ubuntu/focal/Dockerfile @@ -28,19 +28,19 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/17/jre/ubuntu/jammy/Dockerfile b/17/jre/ubuntu/jammy/Dockerfile index ee75b3c81..ea4a8126c 100644 --- a/17/jre/ubuntu/jammy/Dockerfile +++ b/17/jre/ubuntu/jammy/Dockerfile @@ -28,19 +28,19 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/17/jre/windows/nanoserver-1809/Dockerfile b/17/jre/windows/nanoserver-1809/Dockerfile index ef64d1d98..a83f4ba02 100644 --- a/17/jre/windows/nanoserver-1809/Dockerfile +++ b/17/jre/windows/nanoserver-1809/Dockerfile @@ -21,7 +21,7 @@ FROM mcr.microsoft.com/windows/nanoserver:1809 SHELL ["cmd", "/s", "/c"] -ENV JAVA_VERSION jdk-17.0.9+9.1 +ENV JAVA_VERSION jdk-17.0.9+9 ENV JAVA_HOME C:\\openjdk-17 # "ERROR: Access to the registry path is denied." @@ -31,8 +31,8 @@ RUN echo Updating PATH: %JAVA_HOME%\bin;%PATH% \ && echo Complete. USER ContainerUser -COPY --from=eclipse-temurin:17.0.9_9.1-jre-windowsservercore-1809 $JAVA_HOME $JAVA_HOME +COPY --from=eclipse-temurin:17.0.9_9-jre-windowsservercore-1809 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "java --version"; java --version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo java --version && java --version \ + && echo Complete. diff --git a/17/jre/windows/nanoserver-ltsc2022/Dockerfile b/17/jre/windows/nanoserver-ltsc2022/Dockerfile index b99d0b6ed..efc99d4fb 100644 --- a/17/jre/windows/nanoserver-ltsc2022/Dockerfile +++ b/17/jre/windows/nanoserver-ltsc2022/Dockerfile @@ -21,7 +21,7 @@ FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 SHELL ["cmd", "/s", "/c"] -ENV JAVA_VERSION jdk-17.0.9+9.1 +ENV JAVA_VERSION jdk-17.0.9+9 ENV JAVA_HOME C:\\openjdk-17 # "ERROR: Access to the registry path is denied." @@ -31,8 +31,8 @@ RUN echo Updating PATH: %JAVA_HOME%\bin;%PATH% \ && echo Complete. USER ContainerUser -COPY --from=eclipse-temurin:17.0.9_9.1-jre-windowsservercore-ltsc2022 $JAVA_HOME $JAVA_HOME +COPY --from=eclipse-temurin:17.0.9_9-jre-windowsservercore-ltsc2022 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "java --version"; java --version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo java --version && java --version \ + && echo Complete. diff --git a/17/jre/windows/windowsservercore-1809/Dockerfile b/17/jre/windows/windowsservercore-1809/Dockerfile index 3a178d13b..5a36a59c5 100644 --- a/17/jre/windows/windowsservercore-1809/Dockerfile +++ b/17/jre/windows/windowsservercore-1809/Dockerfile @@ -22,7 +22,7 @@ FROM mcr.microsoft.com/windows/servercore:1809 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-17.0.9+9.1 +ENV JAVA_VERSION jdk-17.0.9+9 RUN Write-Host ('Downloading https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9.1/OpenJDK17U-jre_x64_windows_hotspot_17.0.9_9.msi ...'); \ curl.exe -LfsSo openjdk.msi https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9.1/OpenJDK17U-jre_x64_windows_hotspot_17.0.9_9.msi ; \ diff --git a/17/jre/windows/windowsservercore-ltsc2022/Dockerfile b/17/jre/windows/windowsservercore-ltsc2022/Dockerfile index 1d8832858..05067a7df 100644 --- a/17/jre/windows/windowsservercore-ltsc2022/Dockerfile +++ b/17/jre/windows/windowsservercore-ltsc2022/Dockerfile @@ -22,7 +22,7 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-17.0.9+9.1 +ENV JAVA_VERSION jdk-17.0.9+9 RUN Write-Host ('Downloading https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9.1/OpenJDK17U-jre_x64_windows_hotspot_17.0.9_9.msi ...'); \ curl.exe -LfsSo openjdk.msi https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9.1/OpenJDK17U-jre_x64_windows_hotspot_17.0.9_9.msi ; \ diff --git a/21/jdk/alpine/Dockerfile b/21/jdk/alpine/Dockerfile index e18618e96..dacf2cc6f 100644 --- a/21/jdk/alpine/Dockerfile +++ b/21/jdk/alpine/Dockerfile @@ -26,10 +26,24 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - # fontconfig and ttf-dejavu added to support serverside image generation by Java programs - # java-cacerts added to support adding CA certificates to the Java keystore - # bash is required for the entrypoint script (see https://github.com/adoptium/containers/issues/415) - apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib; \ + apk add --no-cache \ + # bash is required for the entrypoint script + # see https://github.com/adoptium/containers/issues/415 + bash \ + # fontconfig and ttf-dejavu added to support serverside image generation by Java programs + fontconfig ttf-dejavu \ + # java-cacerts added to support adding CA certificates to the Java keystore + java-cacerts \ + # fixes issues with apk del apk-tools + # see https://github.com/adoptium/containers/issues/136 + libretls zlib \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + musl-locales musl-locales-lang \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + ; \ rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk-21.0.1+12 diff --git a/21/jdk/ubi/ubi9-minimal/Dockerfile b/21/jdk/ubi/ubi9-minimal/Dockerfile index 4723ae699..e4be4c5b4 100644 --- a/21/jdk/ubi/ubi9-minimal/Dockerfile +++ b/21/jdk/ubi/ubi9-minimal/Dockerfile @@ -26,7 +26,20 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf install -y \ + gzip \ + tar \ + # Required for objdump and also jlink + binutils \ + tzdata \ + openssl \ + wget \ + # utilities for keeping UBI and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + fontconfig \ + glibc-langpack-en \ + ; \ microdnf clean all ENV JAVA_VERSION jdk-21.0.1+12 diff --git a/21/jdk/ubuntu/jammy/Dockerfile b/21/jdk/ubuntu/jammy/Dockerfile index 35562be0c..bfbd016fa 100644 --- a/21/jdk/ubuntu/jammy/Dockerfile +++ b/21/jdk/ubuntu/jammy/Dockerfile @@ -28,19 +28,19 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/21/jdk/windows/nanoserver-1809/Dockerfile b/21/jdk/windows/nanoserver-1809/Dockerfile index cd9213181..40a06162a 100644 --- a/21/jdk/windows/nanoserver-1809/Dockerfile +++ b/21/jdk/windows/nanoserver-1809/Dockerfile @@ -33,9 +33,9 @@ USER ContainerUser COPY --from=eclipse-temurin:21.0.1_12-jdk-windowsservercore-1809 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "javac --version"; javac --version; \ - echo "java --version"; java --version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo javac --version && javac --version \ + && echo java --version && java --version \ + && echo Complete. CMD ["jshell"] diff --git a/21/jdk/windows/nanoserver-ltsc2022/Dockerfile b/21/jdk/windows/nanoserver-ltsc2022/Dockerfile index eff5d274e..3f9cf32b9 100644 --- a/21/jdk/windows/nanoserver-ltsc2022/Dockerfile +++ b/21/jdk/windows/nanoserver-ltsc2022/Dockerfile @@ -33,9 +33,9 @@ USER ContainerUser COPY --from=eclipse-temurin:21.0.1_12-jdk-windowsservercore-ltsc2022 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "javac --version"; javac --version; \ - echo "java --version"; java --version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo javac --version && javac --version \ + && echo java --version && java --version \ + && echo Complete. CMD ["jshell"] diff --git a/21/jre/alpine/Dockerfile b/21/jre/alpine/Dockerfile index c941a48e6..afb1d21ed 100644 --- a/21/jre/alpine/Dockerfile +++ b/21/jre/alpine/Dockerfile @@ -26,10 +26,24 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - # fontconfig and ttf-dejavu added to support serverside image generation by Java programs - # java-cacerts added to support adding CA certificates to the Java keystore - # bash is required for the entrypoint script (see https://github.com/adoptium/containers/issues/415) - apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib; \ + apk add --no-cache \ + # bash is required for the entrypoint script + # see https://github.com/adoptium/containers/issues/415 + bash \ + # fontconfig and ttf-dejavu added to support serverside image generation by Java programs + fontconfig ttf-dejavu \ + # java-cacerts added to support adding CA certificates to the Java keystore + java-cacerts \ + # fixes issues with apk del apk-tools + # see https://github.com/adoptium/containers/issues/136 + libretls zlib \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + musl-locales musl-locales-lang \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + ; \ rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk-21.0.1+12 diff --git a/21/jre/ubi/ubi9-minimal/Dockerfile b/21/jre/ubi/ubi9-minimal/Dockerfile index b3e035559..79dbb3c7a 100644 --- a/21/jre/ubi/ubi9-minimal/Dockerfile +++ b/21/jre/ubi/ubi9-minimal/Dockerfile @@ -26,7 +26,20 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf install -y \ + gzip \ + tar \ + # Required for objdump and also jlink + binutils \ + tzdata \ + openssl \ + wget \ + # utilities for keeping UBI and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + fontconfig \ + glibc-langpack-en \ + ; \ microdnf clean all ENV JAVA_VERSION jdk-21.0.1+12 diff --git a/21/jre/ubuntu/jammy/Dockerfile b/21/jre/ubuntu/jammy/Dockerfile index 64e476c3b..4248fed81 100644 --- a/21/jre/ubuntu/jammy/Dockerfile +++ b/21/jre/ubuntu/jammy/Dockerfile @@ -28,19 +28,19 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/21/jre/windows/nanoserver-1809/Dockerfile b/21/jre/windows/nanoserver-1809/Dockerfile index acbd3571e..649397f19 100644 --- a/21/jre/windows/nanoserver-1809/Dockerfile +++ b/21/jre/windows/nanoserver-1809/Dockerfile @@ -33,6 +33,6 @@ USER ContainerUser COPY --from=eclipse-temurin:21.0.1_12-jre-windowsservercore-1809 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "java --version"; java --version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo java --version && java --version \ + && echo Complete. diff --git a/21/jre/windows/nanoserver-ltsc2022/Dockerfile b/21/jre/windows/nanoserver-ltsc2022/Dockerfile index fb9c882e6..c66734ae4 100644 --- a/21/jre/windows/nanoserver-ltsc2022/Dockerfile +++ b/21/jre/windows/nanoserver-ltsc2022/Dockerfile @@ -33,6 +33,6 @@ USER ContainerUser COPY --from=eclipse-temurin:21.0.1_12-jre-windowsservercore-ltsc2022 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "java --version"; java --version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo java --version && java --version \ + && echo Complete. diff --git a/8/jdk/alpine/Dockerfile b/8/jdk/alpine/Dockerfile index b7a905b41..16796b746 100644 --- a/8/jdk/alpine/Dockerfile +++ b/8/jdk/alpine/Dockerfile @@ -26,10 +26,21 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - # fontconfig and ttf-dejavu added to support serverside image generation by Java programs - # java-cacerts added to support adding CA certificates to the Java keystore - # bash is required for the entrypoint script (see https://github.com/adoptium/containers/issues/415) - apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib; \ + apk add --no-cache \ + # bash is required for the entrypoint script + # see https://github.com/adoptium/containers/issues/415 + bash \ + # fontconfig and ttf-dejavu added to support serverside image generation by Java programs + fontconfig ttf-dejavu \ + # java-cacerts added to support adding CA certificates to the Java keystore + java-cacerts \ + # fixes issues with apk del apk-tools + # see https://github.com/adoptium/containers/issues/136 + libretls zlib \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + musl-locales musl-locales-lang \ + tzdata \ + ; \ rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk8u392-b08 diff --git a/8/jdk/centos/Dockerfile b/8/jdk/centos/Dockerfile index a67ac8a69..ae2755594 100644 --- a/8/jdk/centos/Dockerfile +++ b/8/jdk/centos/Dockerfile @@ -27,17 +27,17 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ yum install -y \ - gzip \ - tar \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - tzdata \ - openssl \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates \ - fontconfig \ + gzip \ + tar \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + tzdata \ + openssl \ + # utilities for keeping Centos and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + fontconfig \ ; \ rm -rf /var/cache/yum diff --git a/8/jdk/ubi/ubi9-minimal/Dockerfile b/8/jdk/ubi/ubi9-minimal/Dockerfile index 95ecf4063..db0895796 100644 --- a/8/jdk/ubi/ubi9-minimal/Dockerfile +++ b/8/jdk/ubi/ubi9-minimal/Dockerfile @@ -26,7 +26,20 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf install -y \ + gzip \ + tar \ + # Required for objdump and also jlink + binutils \ + tzdata \ + openssl \ + wget \ + # utilities for keeping UBI and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + fontconfig \ + glibc-langpack-en \ + ; \ microdnf clean all ENV JAVA_VERSION jdk8u392-b08 diff --git a/8/jdk/ubuntu/focal/Dockerfile b/8/jdk/ubuntu/focal/Dockerfile index 5f272a79e..5bf1be677 100644 --- a/8/jdk/ubuntu/focal/Dockerfile +++ b/8/jdk/ubuntu/focal/Dockerfile @@ -28,16 +28,16 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/8/jdk/ubuntu/jammy/Dockerfile b/8/jdk/ubuntu/jammy/Dockerfile index f274819d6..d45cb76ee 100644 --- a/8/jdk/ubuntu/jammy/Dockerfile +++ b/8/jdk/ubuntu/jammy/Dockerfile @@ -28,16 +28,16 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/8/jdk/windows/nanoserver-1809/Dockerfile b/8/jdk/windows/nanoserver-1809/Dockerfile index 9837a737b..609aff572 100644 --- a/8/jdk/windows/nanoserver-1809/Dockerfile +++ b/8/jdk/windows/nanoserver-1809/Dockerfile @@ -33,7 +33,7 @@ USER ContainerUser COPY --from=eclipse-temurin:8u392-b08-jdk-windowsservercore-1809 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "javac -version"; javac -version; \ - echo "java -version"; java -version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo javac -version && javac -version \ + && echo java -version && java -version \ + && echo Complete. diff --git a/8/jdk/windows/nanoserver-ltsc2022/Dockerfile b/8/jdk/windows/nanoserver-ltsc2022/Dockerfile index 4db3704ca..6d719e754 100644 --- a/8/jdk/windows/nanoserver-ltsc2022/Dockerfile +++ b/8/jdk/windows/nanoserver-ltsc2022/Dockerfile @@ -33,7 +33,7 @@ USER ContainerUser COPY --from=eclipse-temurin:8u392-b08-jdk-windowsservercore-ltsc2022 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "javac -version"; javac -version; \ - echo "java -version"; java -version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo javac -version && javac -version \ + && echo java -version && java -version \ + && echo Complete. diff --git a/8/jre/alpine/Dockerfile b/8/jre/alpine/Dockerfile index ff78ff598..402806e47 100644 --- a/8/jre/alpine/Dockerfile +++ b/8/jre/alpine/Dockerfile @@ -26,10 +26,21 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - # fontconfig and ttf-dejavu added to support serverside image generation by Java programs - # java-cacerts added to support adding CA certificates to the Java keystore - # bash is required for the entrypoint script (see https://github.com/adoptium/containers/issues/415) - apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib; \ + apk add --no-cache \ + # bash is required for the entrypoint script + # see https://github.com/adoptium/containers/issues/415 + bash \ + # fontconfig and ttf-dejavu added to support serverside image generation by Java programs + fontconfig ttf-dejavu \ + # java-cacerts added to support adding CA certificates to the Java keystore + java-cacerts \ + # fixes issues with apk del apk-tools + # see https://github.com/adoptium/containers/issues/136 + libretls zlib \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + musl-locales musl-locales-lang \ + tzdata \ + ; \ rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk8u392-b08 diff --git a/8/jre/centos/Dockerfile b/8/jre/centos/Dockerfile index 52de2e222..50a34051d 100644 --- a/8/jre/centos/Dockerfile +++ b/8/jre/centos/Dockerfile @@ -27,17 +27,17 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ yum install -y \ - gzip \ - tar \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - tzdata \ - openssl \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates \ - fontconfig \ + gzip \ + tar \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + tzdata \ + openssl \ + # utilities for keeping Centos and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + fontconfig \ ; \ rm -rf /var/cache/yum diff --git a/8/jre/ubi/ubi9-minimal/Dockerfile b/8/jre/ubi/ubi9-minimal/Dockerfile index 8c14979db..af30e18e6 100644 --- a/8/jre/ubi/ubi9-minimal/Dockerfile +++ b/8/jre/ubi/ubi9-minimal/Dockerfile @@ -26,7 +26,20 @@ ENV PATH $JAVA_HOME/bin:$PATH ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ - microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf install -y \ + gzip \ + tar \ + # Required for objdump and also jlink + binutils \ + tzdata \ + openssl \ + wget \ + # utilities for keeping UBI and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + fontconfig \ + glibc-langpack-en \ + ; \ microdnf clean all ENV JAVA_VERSION jdk8u392-b08 diff --git a/8/jre/ubuntu/focal/Dockerfile b/8/jre/ubuntu/focal/Dockerfile index d90a51469..08885d82f 100644 --- a/8/jre/ubuntu/focal/Dockerfile +++ b/8/jre/ubuntu/focal/Dockerfile @@ -28,16 +28,16 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/8/jre/ubuntu/jammy/Dockerfile b/8/jre/ubuntu/jammy/Dockerfile index e4ee9ed76..2bf37107d 100644 --- a/8/jre/ubuntu/jammy/Dockerfile +++ b/8/jre/ubuntu/jammy/Dockerfile @@ -28,16 +28,16 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ diff --git a/8/jre/windows/nanoserver-1809/Dockerfile b/8/jre/windows/nanoserver-1809/Dockerfile index 765c3059f..8d75a2414 100644 --- a/8/jre/windows/nanoserver-1809/Dockerfile +++ b/8/jre/windows/nanoserver-1809/Dockerfile @@ -33,6 +33,6 @@ USER ContainerUser COPY --from=eclipse-temurin:8u392-b08-jre-windowsservercore-1809 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "java -version"; java -version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo java -version && java -version \ + && echo Complete. diff --git a/8/jre/windows/nanoserver-ltsc2022/Dockerfile b/8/jre/windows/nanoserver-ltsc2022/Dockerfile index 2340d7bfd..c4481cb96 100644 --- a/8/jre/windows/nanoserver-ltsc2022/Dockerfile +++ b/8/jre/windows/nanoserver-ltsc2022/Dockerfile @@ -33,6 +33,6 @@ USER ContainerUser COPY --from=eclipse-temurin:8u392-b08-jre-windowsservercore-ltsc2022 $JAVA_HOME $JAVA_HOME -RUN echo "Verifying install ..."; \ - echo "java -version"; java -version; \ - echo "Complete." +RUN echo Verifying install ... \ + && echo java -version && java -version \ + && echo Complete. diff --git a/docker_templates/alpine-linux.Dockerfile.j2 b/docker_templates/alpine-linux.Dockerfile.j2 index eeffbc49a..fbe694aa5 100644 --- a/docker_templates/alpine-linux.Dockerfile.j2 +++ b/docker_templates/alpine-linux.Dockerfile.j2 @@ -5,16 +5,26 @@ FROM {{ base_image }} {% include 'partials/nix-env.j2' %} RUN set -eux; \ - # fontconfig and ttf-dejavu added to support serverside image generation by Java programs - # java-cacerts added to support adding CA certificates to the Java keystore - # bash is required for the entrypoint script (see https://github.com/adoptium/containers/issues/415) - apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib; \ + apk add --no-cache \ + # bash is required for the entrypoint script + # see https://github.com/adoptium/containers/issues/415 + bash \ + # fontconfig and ttf-dejavu added to support serverside image generation by Java programs + fontconfig ttf-dejavu \ + # java-cacerts added to support adding CA certificates to the Java keystore + java-cacerts \ + # fixes issues with apk del apk-tools + # see https://github.com/adoptium/containers/issues/136 + libretls zlib \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + musl-locales musl-locales-lang \ +{% include 'partials/binutils.j2' -%} + tzdata \ + ; \ rm -rf /var/cache/apk/* ENV JAVA_VERSION {{ java_version }} -RUN set -eux; \ - ARCH="$(apk --print-arch)"; \ {% include 'partials/multi-arch-install.j2' %} {% include 'partials/version-check.j2' %} diff --git a/docker_templates/centos.Dockerfile.j2 b/docker_templates/centos.Dockerfile.j2 index f28e53fb7..c4d65146e 100644 --- a/docker_templates/centos.Dockerfile.j2 +++ b/docker_templates/centos.Dockerfile.j2 @@ -6,31 +6,25 @@ FROM {{ base_image }} RUN set -eux; \ yum install -y \ - gzip \ - tar \ - {% if version|int < 22 -%} - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - {% endif -%} - wget \ - tzdata \ - openssl \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates \ - fontconfig \ - {% if version|int >= 13 -%} - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ - {% endif -%} + gzip \ + tar \ + {% if version|int < 22 -%} + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + {% endif -%} + wget \ + tzdata \ + openssl \ + # utilities for keeping Centos and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ +{% include 'partials/binutils.j2' -%} + fontconfig \ ; \ rm -rf /var/cache/yum ENV JAVA_VERSION {{ java_version }} -RUN set -eux; \ - ARCH="$(objdump="$(command -v objdump)" && objdump --file-headers "$objdump" | awk -F '[:,]+[[:space:]]+' '$1 == "architecture" { print $2 }')"; \ {% include 'partials/multi-arch-install.j2' %} {% include 'partials/version-check.j2' %} diff --git a/docker_templates/nanoserver.Dockerfile.j2 b/docker_templates/nanoserver.Dockerfile.j2 index d40f7fd9b..7341568bc 100644 --- a/docker_templates/nanoserver.Dockerfile.j2 +++ b/docker_templates/nanoserver.Dockerfile.j2 @@ -16,5 +16,10 @@ USER ContainerUser COPY --from=eclipse-temurin:{{ arch_data.copy_from }} $JAVA_HOME $JAVA_HOME -{% include 'partials/version-check.j2' %} +RUN echo Verifying install ... \ + {% if image_type == "jdk" -%} + && echo javac {% if version|int >= 11 %}--{% else %}-{% endif %}version && javac {% if version|int >= 11 %}--{% else %}-{% endif %}version \ + {% endif -%} + && echo java {% if version|int >= 11 %}--{% else %}-{% endif %}version && java {% if version|int >= 11 %}--{% else %}-{% endif %}version \ + && echo Complete. {% include 'partials/jshell.j2' %} \ No newline at end of file diff --git a/docker_templates/partials/arch-variable.j2 b/docker_templates/partials/arch-variable.j2 new file mode 100644 index 000000000..0256e81e9 --- /dev/null +++ b/docker_templates/partials/arch-variable.j2 @@ -0,0 +1,7 @@ +{%- if os == "ubuntu" %} + ARCH="$(dpkg --print-architecture)"; \ +{%- elif os == "alpine-linux" %} + ARCH="$(apk --print-arch)"; \ +{%- elif os == "centos" or os == "ubi9-minimal" %} + ARCH="$(objdump="$(command -v objdump)" && objdump --file-headers "$objdump" | awk -F '[:,]+[[:space:]]+' '$1 == "architecture" { print $2 }')"; \ +{%- endif -%} \ No newline at end of file diff --git a/docker_templates/partials/binutils.j2 b/docker_templates/partials/binutils.j2 new file mode 100644 index 000000000..9a1aa8da3 --- /dev/null +++ b/docker_templates/partials/binutils.j2 @@ -0,0 +1,5 @@ + {% if version|int >= 13 -%} + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + {% endif -%} \ No newline at end of file diff --git a/docker_templates/partials/multi-arch-install.j2 b/docker_templates/partials/multi-arch-install.j2 index b315f1358..1b32f8a77 100644 --- a/docker_templates/partials/multi-arch-install.j2 +++ b/docker_templates/partials/multi-arch-install.j2 @@ -1,3 +1,5 @@ +RUN set -eux; \ +{%- include 'partials/arch-variable.j2' %} case "${ARCH}" in \ {% for architecture, details in arch_data.items() -%} {{ architecture }}) \ diff --git a/docker_templates/partials/version-check-windows.j2 b/docker_templates/partials/version-check-windows.j2 index 780eb25a4..fa4c2daac 100644 --- a/docker_templates/partials/version-check-windows.j2 +++ b/docker_templates/partials/version-check-windows.j2 @@ -1,14 +1,7 @@ RUN Write-Host 'Verifying install ...'; \ - {% if version|int >= 11 -%} {% if image_type == "jdk" -%} - Write-Host 'javac --version'; javac --version; \ - {% endif -%} - Write-Host 'java --version'; java --version; \ - {% else -%} - {% if image_type == "jdk" -%} - Write-Host 'javac -version'; javac -version; \ - {% endif -%} - Write-Host 'java -version'; java -version; \ + Write-Host 'javac {% if version|int >= 11 %}--{% else %}-{% endif %}version'; javac {% if version|int >= 11 %}--{% else %}-{% endif %}version; \ {% endif -%} + Write-Host 'java {% if version|int >= 11 %}--{% else %}-{% endif %}version'; java {% if version|int >= 11 %}--{% else %}-{% endif %}version; \ \ Write-Host 'Complete.' \ No newline at end of file diff --git a/docker_templates/partials/version-check.j2 b/docker_templates/partials/version-check.j2 index 5ed2fe14a..50afca768 100644 --- a/docker_templates/partials/version-check.j2 +++ b/docker_templates/partials/version-check.j2 @@ -1,6 +1,6 @@ -RUN {% if os_family != "windows" %}set -eux; \ - {% else %}{% endif %}echo "Verifying install ..."; \ - {% if os_family != "windows" and image_type == "jdk" and version|int >= 11 -%} +RUN set -eux; \ + echo "Verifying install ..."; \ + {% if image_type == "jdk" and version|int >= 11 -%} fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ {% endif -%} {% if image_type == "jdk" -%} diff --git a/docker_templates/ubi9-minimal.Dockerfile.j2 b/docker_templates/ubi9-minimal.Dockerfile.j2 index 9a2ebbfa3..4a5b7ffdc 100644 --- a/docker_templates/ubi9-minimal.Dockerfile.j2 +++ b/docker_templates/ubi9-minimal.Dockerfile.j2 @@ -5,13 +5,24 @@ FROM {{ base_image }} {% include 'partials/nix-env.j2' %} RUN set -eux; \ - microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf install -y \ + gzip \ + tar \ + # Required for objdump and also jlink + binutils \ + tzdata \ + openssl \ + wget \ + # utilities for keeping UBI and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + fontconfig \ + glibc-langpack-en \ + ; \ microdnf clean all ENV JAVA_VERSION {{ java_version }} -RUN set -eux; \ - ARCH="$(objdump="$(command -v objdump)" && objdump --file-headers "$objdump" | awk -F '[:,]+[[:space:]]+' '$1 == "architecture" { print $2 }')"; \ {% include 'partials/multi-arch-install.j2' %} {% include 'partials/version-check.j2' %} diff --git a/docker_templates/ubuntu.Dockerfile.j2 b/docker_templates/ubuntu.Dockerfile.j2 index 8991dc917..8d8531b24 100644 --- a/docker_templates/ubuntu.Dockerfile.j2 +++ b/docker_templates/ubuntu.Dockerfile.j2 @@ -7,23 +7,19 @@ FROM {{ base_image }} RUN set -eux; \ apt-get update; \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - {% if version|int < 22 -%} - # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 - curl \ - {% endif -%} - wget \ - fontconfig \ - # utilities for keeping Ubuntu and OpenJDK CA certificates in sync - # https://github.com/adoptium/containers/issues/293 - ca-certificates p11-kit \ - {% if version|int >= 13 -%} - # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 - # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory - binutils \ - {% endif -%} - tzdata \ - # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 - locales \ + {% if version|int < 22 -%} + # curl required for historical reasons, see https://github.com/adoptium/containers/issues/255 + curl \ + {% endif -%} + wget \ + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ +{% include 'partials/binutils.j2' -%} + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + locales \ ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen en_US.UTF-8; \ @@ -31,8 +27,6 @@ RUN set -eux; \ ENV JAVA_VERSION {{ java_version }} -RUN set -eux; \ - ARCH="$(dpkg --print-architecture)"; \ {% include 'partials/multi-arch-install.j2' %} \ # https://github.com/docker-library/openjdk/issues/331#issuecomment-498834472 find "$JAVA_HOME/lib" -name '*.so' -exec dirname '{}' ';' | sort -u > /etc/ld.so.conf.d/docker-openjdk.conf; \ diff --git a/generate_dockerfiles.py b/generate_dockerfiles.py index c5461d037..e3c32cf9e 100644 --- a/generate_dockerfiles.py +++ b/generate_dockerfiles.py @@ -74,7 +74,7 @@ def archHelper(arch, os_family): os.makedirs(output_directory, exist_ok=True) # Fetch latest release for version from Adoptium API - url = f"https://api.adoptium.net/v3/assets/feature_releases/{version}/ga?page=0&image_type={image_type}&page_size=1&vendor=eclipse" + url = f"https://api.adoptium.net/v3/assets/feature_releases/{version}/ga?page=0&image_type={image_type}&os={os_family}&page_size=1&vendor=eclipse" response = requests.get(url, headers=headers) response.raise_for_status() data = response.json() @@ -84,6 +84,13 @@ def archHelper(arch, os_family): # Extract the version number from the release name openjdk_version = release["release_name"] + # If version doesn't equal 8, get the more accurate version number + if version != 8: + openjdk_version = "jdk-" + release["version_data"]["openjdk_version"] + # if openjdk_version contains -LTS remove it + if "-LTS" in openjdk_version: + openjdk_version = openjdk_version.replace("-LTS", "") + # Generate the data for each architecture arch_data = {}