diff --git a/11/jdk/alpine/Dockerfile b/11/jdk/alpine/Dockerfile index da3b4a62f..104bd8e1c 100644 --- a/11/jdk/alpine/Dockerfile +++ b/11/jdk/alpine/Dockerfile @@ -25,11 +25,12 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -# 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 (s. https://github.com/adoptium/containers/issues/415) -RUN apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib \ - && rm -rf /var/cache/apk/* +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; \ + rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk-11.0.21+9 @@ -45,7 +46,7 @@ RUN set -eux; \ exit 1; \ ;; \ esac; \ - wget --progress=dot:giga -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ + wget -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ mkdir -p "$JAVA_HOME"; \ tar --extract \ @@ -59,8 +60,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo javac --version && javac --version; \ - echo java --version && java --version; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/11/jdk/centos/Dockerfile b/11/jdk/centos/Dockerfile index 613e0b2dc..ef5d357bc 100644 --- a/11/jdk/centos/Dockerfile +++ b/11/jdk/centos/Dockerfile @@ -77,8 +77,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo javac --version && javac --version; \ - echo java --version && java --version; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/11/jdk/ubi/ubi9-minimal/Dockerfile b/11/jdk/ubi/ubi9-minimal/Dockerfile index ab25f0023..0ad81f47c 100644 --- a/11/jdk/ubi/ubi9-minimal/Dockerfile +++ b/11/jdk/ubi/ubi9-minimal/Dockerfile @@ -25,8 +25,9 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -RUN microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar \ - && microdnf clean all +RUN set -eux; \ + microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf clean all ENV JAVA_VERSION jdk-11.0.21+9 @@ -68,8 +69,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo javac --version && javac --version; \ - echo java --version && java --version; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/11/jdk/ubuntu/focal/Dockerfile b/11/jdk/ubuntu/focal/Dockerfile index f2c324abf..0b413f6f3 100644 --- a/11/jdk/ubuntu/focal/Dockerfile +++ b/11/jdk/ubuntu/focal/Dockerfile @@ -89,8 +89,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo javac --version && javac --version; \ - echo java --version && java --version; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/11/jdk/ubuntu/jammy/Dockerfile b/11/jdk/ubuntu/jammy/Dockerfile index caafebd45..907e7177e 100644 --- a/11/jdk/ubuntu/jammy/Dockerfile +++ b/11/jdk/ubuntu/jammy/Dockerfile @@ -89,8 +89,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo javac --version && javac --version; \ - echo java --version && java --version; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/11/jdk/windows/nanoserver-1809/Dockerfile b/11/jdk/windows/nanoserver-1809/Dockerfile index 82cc12609..39ff4ee50 100644 --- a/11/jdk/windows/nanoserver-1809/Dockerfile +++ b/11/jdk/windows/nanoserver-1809/Dockerfile @@ -34,8 +34,8 @@ 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 "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 a3bc8d2ca..d96bd01b4 100644 --- a/11/jdk/windows/nanoserver-ltsc2022/Dockerfile +++ b/11/jdk/windows/nanoserver-ltsc2022/Dockerfile @@ -34,8 +34,8 @@ 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 "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 4398bfa76..3514b88d3 100644 --- a/11/jre/alpine/Dockerfile +++ b/11/jre/alpine/Dockerfile @@ -25,11 +25,12 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -# 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 (s. https://github.com/adoptium/containers/issues/415) -RUN apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib \ - && rm -rf /var/cache/apk/* +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; \ + rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk-11.0.21+9 @@ -45,7 +46,7 @@ RUN set -eux; \ exit 1; \ ;; \ esac; \ - wget --progress=dot:giga -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ + wget -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ mkdir -p "$JAVA_HOME"; \ tar --extract \ @@ -58,8 +59,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo java --version && java --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/11/jre/centos/Dockerfile b/11/jre/centos/Dockerfile index f06f70bfc..acd7281ef 100644 --- a/11/jre/centos/Dockerfile +++ b/11/jre/centos/Dockerfile @@ -76,8 +76,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo java --version && java --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/11/jre/ubi/ubi9-minimal/Dockerfile b/11/jre/ubi/ubi9-minimal/Dockerfile index 823df3e9c..ce128d397 100644 --- a/11/jre/ubi/ubi9-minimal/Dockerfile +++ b/11/jre/ubi/ubi9-minimal/Dockerfile @@ -25,8 +25,9 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -RUN microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar \ - && microdnf clean all +RUN set -eux; \ + microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf clean all ENV JAVA_VERSION jdk-11.0.21+9 @@ -67,8 +68,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo java --version && java --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/11/jre/ubuntu/focal/Dockerfile b/11/jre/ubuntu/focal/Dockerfile index 0ab7eab5b..81428a69e 100644 --- a/11/jre/ubuntu/focal/Dockerfile +++ b/11/jre/ubuntu/focal/Dockerfile @@ -88,8 +88,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo java --version && java --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/11/jre/ubuntu/jammy/Dockerfile b/11/jre/ubuntu/jammy/Dockerfile index a0769daad..d3cab7b82 100644 --- a/11/jre/ubuntu/jammy/Dockerfile +++ b/11/jre/ubuntu/jammy/Dockerfile @@ -88,8 +88,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo java --version && java --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/11/jre/windows/nanoserver-1809/Dockerfile b/11/jre/windows/nanoserver-1809/Dockerfile index 85cc2b8fd..b36948ed6 100644 --- a/11/jre/windows/nanoserver-1809/Dockerfile +++ b/11/jre/windows/nanoserver-1809/Dockerfile @@ -34,5 +34,5 @@ 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 "java --version"; java --version; \ echo "Complete." diff --git a/11/jre/windows/nanoserver-ltsc2022/Dockerfile b/11/jre/windows/nanoserver-ltsc2022/Dockerfile index b0d442385..3e2733b59 100644 --- a/11/jre/windows/nanoserver-ltsc2022/Dockerfile +++ b/11/jre/windows/nanoserver-ltsc2022/Dockerfile @@ -34,5 +34,5 @@ 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 "java --version"; java --version; \ echo "Complete." diff --git a/17/jdk/alpine/Dockerfile b/17/jdk/alpine/Dockerfile index 0fb4a76b5..ab320406e 100644 --- a/17/jdk/alpine/Dockerfile +++ b/17/jdk/alpine/Dockerfile @@ -25,11 +25,12 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -# 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 (s. https://github.com/adoptium/containers/issues/415) -RUN apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib \ - && rm -rf /var/cache/apk/* +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; \ + rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk-17.0.9+9 @@ -45,7 +46,7 @@ RUN set -eux; \ exit 1; \ ;; \ esac; \ - wget --progress=dot:giga -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ + wget -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ mkdir -p "$JAVA_HOME"; \ tar --extract \ @@ -59,8 +60,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo javac --version && javac --version; \ - echo java --version && java --version; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/17/jdk/centos/Dockerfile b/17/jdk/centos/Dockerfile index feeef3bdc..18718902b 100644 --- a/17/jdk/centos/Dockerfile +++ b/17/jdk/centos/Dockerfile @@ -80,8 +80,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo javac --version && javac --version; \ - echo java --version && java --version; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/17/jdk/ubi/ubi9-minimal/Dockerfile b/17/jdk/ubi/ubi9-minimal/Dockerfile index f080f2ab6..df8662b44 100644 --- a/17/jdk/ubi/ubi9-minimal/Dockerfile +++ b/17/jdk/ubi/ubi9-minimal/Dockerfile @@ -25,8 +25,9 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -RUN microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar \ - && microdnf clean all +RUN set -eux; \ + microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf clean all ENV JAVA_VERSION jdk-17.0.9+9 @@ -68,8 +69,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo javac --version && javac --version; \ - echo java --version && java --version; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/17/jdk/ubuntu/focal/Dockerfile b/17/jdk/ubuntu/focal/Dockerfile index 7f456ee8d..650c3c614 100644 --- a/17/jdk/ubuntu/focal/Dockerfile +++ b/17/jdk/ubuntu/focal/Dockerfile @@ -92,8 +92,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo javac --version && javac --version; \ - echo java --version && java --version; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/17/jdk/ubuntu/jammy/Dockerfile b/17/jdk/ubuntu/jammy/Dockerfile index 3e6ebfedc..05b2d7870 100644 --- a/17/jdk/ubuntu/jammy/Dockerfile +++ b/17/jdk/ubuntu/jammy/Dockerfile @@ -92,8 +92,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo javac --version && javac --version; \ - echo java --version && java --version; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/17/jre/alpine/Dockerfile b/17/jre/alpine/Dockerfile index 3bdcffb5d..e9555ca2f 100644 --- a/17/jre/alpine/Dockerfile +++ b/17/jre/alpine/Dockerfile @@ -25,11 +25,12 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -# 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 (s. https://github.com/adoptium/containers/issues/415) -RUN apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib \ - && rm -rf /var/cache/apk/* +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; \ + rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk-17.0.9+9 @@ -45,7 +46,7 @@ RUN set -eux; \ exit 1; \ ;; \ esac; \ - wget --progress=dot:giga -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ + wget -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ mkdir -p "$JAVA_HOME"; \ tar --extract \ @@ -58,8 +59,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo java --version && java --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/17/jre/centos/Dockerfile b/17/jre/centos/Dockerfile index e6f2c5203..5558ee836 100644 --- a/17/jre/centos/Dockerfile +++ b/17/jre/centos/Dockerfile @@ -79,8 +79,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo java --version && java --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/17/jre/ubi/ubi9-minimal/Dockerfile b/17/jre/ubi/ubi9-minimal/Dockerfile index daeeb9fe1..5eb70ce50 100644 --- a/17/jre/ubi/ubi9-minimal/Dockerfile +++ b/17/jre/ubi/ubi9-minimal/Dockerfile @@ -25,8 +25,9 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -RUN microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar \ - && microdnf clean all +RUN set -eux; \ + microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf clean all ENV JAVA_VERSION jdk-17.0.9+9 @@ -67,8 +68,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo java --version && java --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/17/jre/ubuntu/focal/Dockerfile b/17/jre/ubuntu/focal/Dockerfile index cbc6eb71d..430f7801d 100644 --- a/17/jre/ubuntu/focal/Dockerfile +++ b/17/jre/ubuntu/focal/Dockerfile @@ -91,8 +91,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo java --version && java --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/17/jre/ubuntu/jammy/Dockerfile b/17/jre/ubuntu/jammy/Dockerfile index a0f7d6fee..e674d957b 100644 --- a/17/jre/ubuntu/jammy/Dockerfile +++ b/17/jre/ubuntu/jammy/Dockerfile @@ -91,8 +91,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo java --version && java --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/21/jdk/alpine/Dockerfile b/21/jdk/alpine/Dockerfile index c02aab79c..e18618e96 100644 --- a/21/jdk/alpine/Dockerfile +++ b/21/jdk/alpine/Dockerfile @@ -25,11 +25,12 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -# 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 (s. https://github.com/adoptium/containers/issues/415) -RUN apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib \ - && rm -rf /var/cache/apk/* +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; \ + rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk-21.0.1+12 @@ -49,7 +50,7 @@ RUN set -eux; \ exit 1; \ ;; \ esac; \ - wget --progress=dot:giga -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ + wget -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ mkdir -p "$JAVA_HOME"; \ tar --extract \ @@ -63,8 +64,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo javac --version && javac --version; \ - echo java --version && java --version; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/21/jdk/ubi/ubi9-minimal/Dockerfile b/21/jdk/ubi/ubi9-minimal/Dockerfile index 45d43849b..4723ae699 100644 --- a/21/jdk/ubi/ubi9-minimal/Dockerfile +++ b/21/jdk/ubi/ubi9-minimal/Dockerfile @@ -25,8 +25,9 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -RUN microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar \ - && microdnf clean all +RUN set -eux; \ + microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf clean all ENV JAVA_VERSION jdk-21.0.1+12 @@ -64,8 +65,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo javac --version && javac --version; \ - echo java --version && java --version; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/21/jdk/ubuntu/jammy/Dockerfile b/21/jdk/ubuntu/jammy/Dockerfile index c9f237228..35562be0c 100644 --- a/21/jdk/ubuntu/jammy/Dockerfile +++ b/21/jdk/ubuntu/jammy/Dockerfile @@ -88,8 +88,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo javac --version && javac --version; \ - echo java --version && java --version; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/21/jre/alpine/Dockerfile b/21/jre/alpine/Dockerfile index d8ec25052..c941a48e6 100644 --- a/21/jre/alpine/Dockerfile +++ b/21/jre/alpine/Dockerfile @@ -25,11 +25,12 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -# 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 (s. https://github.com/adoptium/containers/issues/415) -RUN apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib \ - && rm -rf /var/cache/apk/* +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; \ + rm -rf /var/cache/apk/* ENV JAVA_VERSION jdk-21.0.1+12 @@ -49,7 +50,7 @@ RUN set -eux; \ exit 1; \ ;; \ esac; \ - wget --progress=dot:giga -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ + wget -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ mkdir -p "$JAVA_HOME"; \ tar --extract \ @@ -62,8 +63,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo java --version && java --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/21/jre/ubi/ubi9-minimal/Dockerfile b/21/jre/ubi/ubi9-minimal/Dockerfile index 4947721ff..b3e035559 100644 --- a/21/jre/ubi/ubi9-minimal/Dockerfile +++ b/21/jre/ubi/ubi9-minimal/Dockerfile @@ -25,8 +25,9 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -RUN microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar \ - && microdnf clean all +RUN set -eux; \ + microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf clean all ENV JAVA_VERSION jdk-21.0.1+12 @@ -63,8 +64,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo java --version && java --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/21/jre/ubuntu/jammy/Dockerfile b/21/jre/ubuntu/jammy/Dockerfile index 28b943366..64e476c3b 100644 --- a/21/jre/ubuntu/jammy/Dockerfile +++ b/21/jre/ubuntu/jammy/Dockerfile @@ -87,8 +87,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ - echo java --version && java --version; \ + echo "java --version"; java --version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/8/jdk/centos/Dockerfile b/8/jdk/centos/Dockerfile index c832b925e..a67ac8a69 100644 --- a/8/jdk/centos/Dockerfile +++ b/8/jdk/centos/Dockerfile @@ -76,8 +76,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - echo javac -version && javac -version; \ - echo java -version && java -version; \ + echo "javac -version"; javac -version; \ + echo "java -version"; java -version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/8/jdk/ubi/ubi9-minimal/Dockerfile b/8/jdk/ubi/ubi9-minimal/Dockerfile index 1c84b0d57..95ecf4063 100644 --- a/8/jdk/ubi/ubi9-minimal/Dockerfile +++ b/8/jdk/ubi/ubi9-minimal/Dockerfile @@ -25,8 +25,9 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -RUN microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar \ - && microdnf clean all +RUN set -eux; \ + microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf clean all ENV JAVA_VERSION jdk8u392-b08 @@ -63,8 +64,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - echo javac -version && javac -version; \ - echo java -version && java -version; \ + echo "javac -version"; javac -version; \ + echo "java -version"; java -version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/8/jdk/ubuntu/focal/Dockerfile b/8/jdk/ubuntu/focal/Dockerfile index 1165f843a..5f272a79e 100644 --- a/8/jdk/ubuntu/focal/Dockerfile +++ b/8/jdk/ubuntu/focal/Dockerfile @@ -81,8 +81,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - echo javac -version && javac -version; \ - echo java -version && java -version; \ + echo "javac -version"; javac -version; \ + echo "java -version"; java -version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/8/jdk/ubuntu/jammy/Dockerfile b/8/jdk/ubuntu/jammy/Dockerfile index ae35c3d7f..f274819d6 100644 --- a/8/jdk/ubuntu/jammy/Dockerfile +++ b/8/jdk/ubuntu/jammy/Dockerfile @@ -81,8 +81,8 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - echo javac -version && javac -version; \ - echo java -version && java -version; \ + echo "javac -version"; javac -version; \ + echo "java -version"; java -version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/8/jdk/windows/nanoserver-1809/Dockerfile b/8/jdk/windows/nanoserver-1809/Dockerfile index 8aa6c07b9..9837a737b 100644 --- a/8/jdk/windows/nanoserver-1809/Dockerfile +++ b/8/jdk/windows/nanoserver-1809/Dockerfile @@ -34,6 +34,6 @@ 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 "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 5981e745c..4db3704ca 100644 --- a/8/jdk/windows/nanoserver-ltsc2022/Dockerfile +++ b/8/jdk/windows/nanoserver-ltsc2022/Dockerfile @@ -34,6 +34,6 @@ 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 "javac -version"; javac -version; \ + echo "java -version"; java -version; \ echo "Complete." diff --git a/8/jre/centos/Dockerfile b/8/jre/centos/Dockerfile index 06b197250..52de2e222 100644 --- a/8/jre/centos/Dockerfile +++ b/8/jre/centos/Dockerfile @@ -76,7 +76,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - echo java -version && java -version; \ + echo "java -version"; java -version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/8/jre/ubi/ubi9-minimal/Dockerfile b/8/jre/ubi/ubi9-minimal/Dockerfile index 7402fc14b..8c14979db 100644 --- a/8/jre/ubi/ubi9-minimal/Dockerfile +++ b/8/jre/ubi/ubi9-minimal/Dockerfile @@ -25,8 +25,9 @@ ENV PATH $JAVA_HOME/bin:$PATH # Default to UTF-8 file.encoding ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' -RUN microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar \ - && microdnf clean all +RUN set -eux; \ + microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf clean all ENV JAVA_VERSION jdk8u392-b08 @@ -63,7 +64,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - echo java -version && java -version; \ + echo "java -version"; java -version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/8/jre/ubuntu/focal/Dockerfile b/8/jre/ubuntu/focal/Dockerfile index e0242acbf..d90a51469 100644 --- a/8/jre/ubuntu/focal/Dockerfile +++ b/8/jre/ubuntu/focal/Dockerfile @@ -81,7 +81,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - echo java -version && java -version; \ + echo "java -version"; java -version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/8/jre/ubuntu/jammy/Dockerfile b/8/jre/ubuntu/jammy/Dockerfile index daf63ac63..e4ee9ed76 100644 --- a/8/jre/ubuntu/jammy/Dockerfile +++ b/8/jre/ubuntu/jammy/Dockerfile @@ -81,7 +81,7 @@ RUN set -eux; \ RUN set -eux; \ echo "Verifying install ..."; \ - echo java -version && java -version; \ + echo "java -version"; java -version; \ echo "Complete." COPY entrypoint.sh /__cacert_entrypoint.sh ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/8/jre/windows/nanoserver-1809/Dockerfile b/8/jre/windows/nanoserver-1809/Dockerfile index 108e1ba5c..765c3059f 100644 --- a/8/jre/windows/nanoserver-1809/Dockerfile +++ b/8/jre/windows/nanoserver-1809/Dockerfile @@ -34,5 +34,5 @@ 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 "java -version"; java -version; \ echo "Complete." diff --git a/8/jre/windows/nanoserver-ltsc2022/Dockerfile b/8/jre/windows/nanoserver-ltsc2022/Dockerfile index a3cdf311c..2340d7bfd 100644 --- a/8/jre/windows/nanoserver-ltsc2022/Dockerfile +++ b/8/jre/windows/nanoserver-ltsc2022/Dockerfile @@ -34,5 +34,5 @@ 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 "java -version"; java -version; \ echo "Complete." diff --git a/docker_templates/alpine-linux.Dockerfile.j2 b/docker_templates/alpine-linux.Dockerfile.j2 index 8c751be21..eeffbc49a 100644 --- a/docker_templates/alpine-linux.Dockerfile.j2 +++ b/docker_templates/alpine-linux.Dockerfile.j2 @@ -4,11 +4,12 @@ FROM {{ base_image }} {% include 'partials/nix-env.j2' %} -# 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 (s. https://github.com/adoptium/containers/issues/415) -RUN apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib \ - && rm -rf /var/cache/apk/* +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; \ + rm -rf /var/cache/apk/* ENV JAVA_VERSION {{ java_version }} diff --git a/docker_templates/partials/multi-arch-install.j2 b/docker_templates/partials/multi-arch-install.j2 index bf115f2fb..b315f1358 100644 --- a/docker_templates/partials/multi-arch-install.j2 +++ b/docker_templates/partials/multi-arch-install.j2 @@ -16,7 +16,7 @@ exit 1; \ ;; \ esac; \ - wget --progress=dot:giga -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ + wget {% if os != "alpine-linux" %}--progress=dot:giga {% endif %}-O /tmp/openjdk.tar.gz ${BINARY_URL}; \ echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ mkdir -p "$JAVA_HOME"; \ tar --extract \ diff --git a/docker_templates/partials/version-check.j2 b/docker_templates/partials/version-check.j2 index 6d6f496a2..5ed2fe14a 100644 --- a/docker_templates/partials/version-check.j2 +++ b/docker_templates/partials/version-check.j2 @@ -1,10 +1,10 @@ RUN {% if os_family != "windows" %}set -eux; \ {% else %}{% endif %}echo "Verifying install ..."; \ - {% if os_family != "windows" and version|int >= 11 -%} + {% if os_family != "windows" and 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" -%} - echo javac {% if version|int >= 11 %}--{% else %}-{% endif %}version && javac {% if version|int >= 11 %}--{% else %}-{% endif %}version; \ + 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 "java {% if version|int >= 11 %}--{% else %}-{% endif %}version"; java {% if version|int >= 11 %}--{% else %}-{% endif %}version; \ echo "Complete." \ No newline at end of file diff --git a/docker_templates/ubi9-minimal.Dockerfile.j2 b/docker_templates/ubi9-minimal.Dockerfile.j2 index 083d16d19..9a2ebbfa3 100644 --- a/docker_templates/ubi9-minimal.Dockerfile.j2 +++ b/docker_templates/ubi9-minimal.Dockerfile.j2 @@ -4,8 +4,9 @@ FROM {{ base_image }} {% include 'partials/nix-env.j2' %} -RUN microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar \ - && microdnf clean all +RUN set -eux; \ + microdnf install -y binutils tzdata openssl wget ca-certificates fontconfig glibc-langpack-en gzip tar; \ + microdnf clean all ENV JAVA_VERSION {{ java_version }} diff --git a/test_generate_dockerfiles.py b/test_generate_dockerfiles.py index 7828d2bad..dac37b92c 100644 --- a/test_generate_dockerfiles.py +++ b/test_generate_dockerfiles.py @@ -56,8 +56,8 @@ def test_version_checker(self): rendered_template = template.render(**context) # Expected string/partial in the rendered output - expected_string = "&& echo javac --version && javac --version" - self.assertIn(expected_string, rendered_template) + self.assertIn("javac --version", rendered_template) + self.assertIn("java --version", rendered_template) with self.subTest(): # The context/variables to render the template @@ -65,8 +65,8 @@ def test_version_checker(self): rendered_template = template.render(**context) # Expected string/partial in the rendered output - expected_string = "&& echo javac -version && javac -version" - self.assertIn(expected_string, rendered_template) + self.assertIn("javac -version", rendered_template) + self.assertIn("java -version", rendered_template) with self.subTest(): # The context/variables to render the template @@ -74,8 +74,8 @@ def test_version_checker(self): rendered_template = template.render(**context) # Expected string/partial in the rendered output - expected_string = "&& echo javac --version && javac --version" - self.assertNotIn(expected_string, rendered_template) + self.assertNotIn("javac --version", rendered_template) + self.assertIn("java --version", rendered_template) with self.subTest(): # The context/variables to render the template @@ -83,8 +83,8 @@ def test_version_checker(self): rendered_template = template.render(**context) # Expected string/partial in the rendered output - expected_string = "&& echo javac -version && javac -version" - self.assertNotIn(expected_string, rendered_template) + self.assertNotIn("javac -version", rendered_template) + self.assertIn("java -version", rendered_template) def test_version_checker_windows(self): template_name = "partials/version-check-windows.j2"