diff --git a/11/headful/al2-headful/Dockerfile b/11/headful/al2-headful/Dockerfile new file mode 100644 index 0000000..e585b0b --- /dev/null +++ b/11/headful/al2-headful/Dockerfile @@ -0,0 +1,26 @@ +FROM amazonlinux:2 + +ARG version=11.0.22.7.1 + +RUN set -eux \ + && export resouce_version=$(echo $version | tr '-' '.') \ + && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2 \ + && echo "localpkg_gpgcheck=1" >> /etc/yum.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + && RPM_LIST=("java-11-amazon-corretto-headless-$version.amzn2.1.$(uname -m).rpm" "java-11-amazon-corretto-$version.amzn2.1.$(uname -m).rpm") \ + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/${resouce_version}/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: rsa sha1 (md5) pgp md5 OK" || exit 1 \ + && yum install -y $(yum deplist "${CORRETO_TEMP}/${rpm}" |grep provider | grep -vE "log4j-cve|corretto" | tr -s ' ' |cut -d ' ' -f 3 ); \ + done \ + && rpm -i --nodeps ${CORRETO_TEMP}/*.rpm \ + && popd \ + && (find /usr/lib/jvm/java-11-amazon-corretto.$(uname -m) -name src.zip -delete || true) \ + && rm -rf ${CORRETO_TEMP} \ + && yum clean all \ + && rm -rf /var/cache/yum \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/yum.conf + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-11-amazon-corretto \ No newline at end of file diff --git a/11/headful/al2023-headful/Dockerfile b/11/headful/al2023-headful/Dockerfile new file mode 100644 index 0000000..56973a0 --- /dev/null +++ b/11/headful/al2023-headful/Dockerfile @@ -0,0 +1,24 @@ +FROM amazonlinux:2023 + +ARG version=11.0.22.7.1 +ARG package_version=1 + +RUN set -eux \ + && rpm --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2023 \ + && echo "localpkg_gpgcheck=1" >> /etc/dnf/dnf.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + && RPM_LIST=("java-11-amazon-corretto-headless-$version.amzn2023.${package_version}.$(uname -m).rpm" "java-11-amazon-corretto-$version.amzn2023.${package_version}.$(uname -m).rpm") \ + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/$(echo $version | tr '-' '.')/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: digests signatures OK" || exit 1; \ + done \ + && dnf install -y ${CORRETO_TEMP}/*.rpm \ + && popd \ + && rm -rf /usr/lib/jvm/java-11-amazon-corretto.$(uname -m)/lib/src.zip \ + && rm -rf ${CORRETO_TEMP} \ + && dnf clean all \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/dnf/dnf.conf + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-11-amazon-corretto \ No newline at end of file diff --git a/11/headless/al2-headless/Dockerfile b/11/headless/al2-headless/Dockerfile new file mode 100644 index 0000000..25d4054 --- /dev/null +++ b/11/headless/al2-headless/Dockerfile @@ -0,0 +1,26 @@ +FROM amazonlinux:2 + +ARG version=11.0.22.7.1 + +RUN set -eux \ + && export resouce_version=$(echo $version | tr '-' '.') \ + && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2 \ + && echo "localpkg_gpgcheck=1" >> /etc/yum.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + && RPM_LIST=("java-11-amazon-corretto-headless-$version.amzn2.1.$(uname -m).rpm") \ + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/${resouce_version}/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: rsa sha1 (md5) pgp md5 OK" || exit 1 \ + && yum install -y $(yum deplist "${CORRETO_TEMP}/${rpm}" |grep provider | grep -vE "log4j-cve|corretto" | tr -s ' ' |cut -d ' ' -f 3 ); \ + done \ + && rpm -i --nodeps ${CORRETO_TEMP}/*.rpm \ + && popd \ + && (find /usr/lib/jvm/java-11-amazon-corretto.$(uname -m) -name src.zip -delete || true) \ + && rm -rf ${CORRETO_TEMP} \ + && yum clean all \ + && rm -rf /var/cache/yum \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/yum.conf + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-11-amazon-corretto \ No newline at end of file diff --git a/11/headless/al2023-headless/Dockerfile b/11/headless/al2023-headless/Dockerfile new file mode 100644 index 0000000..3edfe50 --- /dev/null +++ b/11/headless/al2023-headless/Dockerfile @@ -0,0 +1,24 @@ +FROM amazonlinux:2023 + +ARG version=11.0.22.7.1 +ARG package_version=1 + +RUN set -eux \ + && rpm --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2023 \ + && echo "localpkg_gpgcheck=1" >> /etc/dnf/dnf.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + && RPM_LIST=("java-11-amazon-corretto-headless-$version.amzn2023.${package_version}.$(uname -m).rpm") \ + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/$(echo $version | tr '-' '.')/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: digests signatures OK" || exit 1; \ + done \ + && dnf install -y ${CORRETO_TEMP}/*.rpm \ + && popd \ + && rm -rf /usr/lib/jvm/java-11-amazon-corretto.$(uname -m)/lib/src.zip \ + && rm -rf ${CORRETO_TEMP} \ + && dnf clean all \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/dnf/dnf.conf + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-11-amazon-corretto \ No newline at end of file diff --git a/11/jdk/al2-generic/Dockerfile b/11/jdk/al2-generic/Dockerfile index eca0a26..5d250cf 100644 --- a/11/jdk/al2-generic/Dockerfile +++ b/11/jdk/al2-generic/Dockerfile @@ -1,6 +1,6 @@ FROM amazonlinux:2 -ARG version=11.0.22.7-1 +ARG version=11.0.22.7.1 # In addition to installing the Amazon corretto, we also install # fontconfig. The folks who manage the docker hub's # official image library have found that font management @@ -29,4 +29,4 @@ RUN set -eux \ && yum clean all ENV LANG C.UTF-8 -ENV JAVA_HOME=/usr/lib/jvm/java-11-amazon-corretto +ENV JAVA_HOME=/usr/lib/jvm/java-11-amazon-corretto \ No newline at end of file diff --git a/11/jdk/al2/Dockerfile b/11/jdk/al2/Dockerfile index 499910a..a1d58ce 100644 --- a/11/jdk/al2/Dockerfile +++ b/11/jdk/al2/Dockerfile @@ -1,6 +1,6 @@ FROM amazonlinux:2 -ARG version=11.0.22.7-1 +ARG version=11.0.22.7.1 RUN set -eux \ && export resouce_version=$(echo $version | tr '-' '.') \ @@ -12,7 +12,9 @@ RUN set -eux \ && for rpm in ${RPM_LIST[@]}; do \ curl --fail -O https://corretto.aws/downloads/resources/${resouce_version}/${rpm} \ && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: rsa sha1 (md5) pgp md5 OK" || exit 1 \ - && yum install -y $(yum deplist "${CORRETO_TEMP}/${rpm}" |grep provider | grep -vE "log4j-cve|corretto" | tr -s ' ' |cut -d ' ' -f 3 ); \ + && if [[ ${rpm} != *jmods* ]]; then \ + yum install -y $(yum deplist "${CORRETO_TEMP}/${rpm}" |grep provider | grep -vE "log4j-cve|corretto" | tr -s ' ' |cut -d ' ' -f 3 ); \ + fi; \ done \ && rpm -i --nodeps ${CORRETO_TEMP}/*.rpm \ && popd \ @@ -23,4 +25,4 @@ RUN set -eux \ && sed -i '/localpkg_gpgcheck=1/d' /etc/yum.conf ENV LANG C.UTF-8 -ENV JAVA_HOME=/usr/lib/jvm/java-11-amazon-corretto +ENV JAVA_HOME=/usr/lib/jvm/java-11-amazon-corretto \ No newline at end of file diff --git a/11/jdk/al2023/Dockerfile b/11/jdk/al2023/Dockerfile index c6159b6..3541932 100644 --- a/11/jdk/al2023/Dockerfile +++ b/11/jdk/al2023/Dockerfile @@ -1,13 +1,14 @@ FROM amazonlinux:2023 -ARG version=11.0.22.7-1 +ARG version=11.0.22.7.1 +ARG package_version=1 RUN set -eux \ && rpm --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2023 \ && echo "localpkg_gpgcheck=1" >> /etc/dnf/dnf.conf \ && CORRETO_TEMP=$(mktemp -d) \ && pushd ${CORRETO_TEMP} \ - && RPM_LIST=("java-11-amazon-corretto-headless-$version.amzn2023.$(uname -m).rpm" "java-11-amazon-corretto-$version.amzn2023.$(uname -m).rpm" "java-11-amazon-corretto-devel-$version.amzn2023.$(uname -m).rpm" "java-11-amazon-corretto-jmods-$version.amzn2023.$(uname -m).rpm") \ + && RPM_LIST=("java-11-amazon-corretto-headless-$version.amzn2023.${package_version}.$(uname -m).rpm" "java-11-amazon-corretto-$version.amzn2023.${package_version}.$(uname -m).rpm" "java-11-amazon-corretto-devel-$version.amzn2023.${package_version}.$(uname -m).rpm" "java-11-amazon-corretto-jmods-$version.amzn2023.${package_version}.$(uname -m).rpm") \ && for rpm in ${RPM_LIST[@]}; do \ curl --fail -O https://corretto.aws/downloads/resources/$(echo $version | tr '-' '.')/${rpm} \ && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: digests signatures OK" || exit 1; \ @@ -20,4 +21,4 @@ RUN set -eux \ && sed -i '/localpkg_gpgcheck=1/d' /etc/dnf/dnf.conf ENV LANG C.UTF-8 -ENV JAVA_HOME=/usr/lib/jvm/java-11-amazon-corretto +ENV JAVA_HOME=/usr/lib/jvm/java-11-amazon-corretto \ No newline at end of file diff --git a/17/headful/al2-headful/Dockerfile b/17/headful/al2-headful/Dockerfile new file mode 100644 index 0000000..f5cbcdb --- /dev/null +++ b/17/headful/al2-headful/Dockerfile @@ -0,0 +1,26 @@ +FROM amazonlinux:2 + +ARG version=17.0.10.7.1 + +RUN set -eux \ + && export resouce_version=$(echo $version | tr '-' '.') \ + && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2 \ + && echo "localpkg_gpgcheck=1" >> /etc/yum.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + && RPM_LIST=("java-17-amazon-corretto-headless-$version.amzn2.1.$(uname -m).rpm" "java-17-amazon-corretto-$version.amzn2.1.$(uname -m).rpm") \ + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/${resouce_version}/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: rsa sha1 (md5) pgp md5 OK" || exit 1 \ + && yum install -y $(yum deplist "${CORRETO_TEMP}/${rpm}" |grep provider | grep -vE "log4j-cve|corretto" | tr -s ' ' |cut -d ' ' -f 3 ); \ + done \ + && rpm -i --nodeps ${CORRETO_TEMP}/*.rpm \ + && popd \ + && (find /usr/lib/jvm/java-17-amazon-corretto.$(uname -m) -name src.zip -delete || true) \ + && rm -rf ${CORRETO_TEMP} \ + && yum clean all \ + && rm -rf /var/cache/yum \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/yum.conf + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto \ No newline at end of file diff --git a/17/headful/al2023-headful/Dockerfile b/17/headful/al2023-headful/Dockerfile new file mode 100644 index 0000000..b824f46 --- /dev/null +++ b/17/headful/al2023-headful/Dockerfile @@ -0,0 +1,24 @@ +FROM amazonlinux:2023 + +ARG version=17.0.10.7.1 +ARG package_version=1 + +RUN set -eux \ + && rpm --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2023 \ + && echo "localpkg_gpgcheck=1" >> /etc/dnf/dnf.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + && RPM_LIST=("java-17-amazon-corretto-headless-$version.amzn2023.${package_version}.$(uname -m).rpm" "java-17-amazon-corretto-$version.amzn2023.${package_version}.$(uname -m).rpm") \ + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/$(echo $version | tr '-' '.')/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: digests signatures OK" || exit 1; \ + done \ + && dnf install -y ${CORRETO_TEMP}/*.rpm \ + && popd \ + && rm -rf /usr/lib/jvm/java-17-amazon-corretto.$(uname -m)/lib/src.zip \ + && rm -rf ${CORRETO_TEMP} \ + && dnf clean all \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/dnf/dnf.conf + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto \ No newline at end of file diff --git a/17/headless/al2-headless/Dockerfile b/17/headless/al2-headless/Dockerfile new file mode 100644 index 0000000..c1b43b0 --- /dev/null +++ b/17/headless/al2-headless/Dockerfile @@ -0,0 +1,26 @@ +FROM amazonlinux:2 + +ARG version=17.0.10.7.1 + +RUN set -eux \ + && export resouce_version=$(echo $version | tr '-' '.') \ + && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2 \ + && echo "localpkg_gpgcheck=1" >> /etc/yum.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + && RPM_LIST=("java-17-amazon-corretto-headless-$version.amzn2.1.$(uname -m).rpm") \ + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/${resouce_version}/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: rsa sha1 (md5) pgp md5 OK" || exit 1 \ + && yum install -y $(yum deplist "${CORRETO_TEMP}/${rpm}" |grep provider | grep -vE "log4j-cve|corretto" | tr -s ' ' |cut -d ' ' -f 3 ); \ + done \ + && rpm -i --nodeps ${CORRETO_TEMP}/*.rpm \ + && popd \ + && (find /usr/lib/jvm/java-17-amazon-corretto.$(uname -m) -name src.zip -delete || true) \ + && rm -rf ${CORRETO_TEMP} \ + && yum clean all \ + && rm -rf /var/cache/yum \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/yum.conf + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto \ No newline at end of file diff --git a/17/headless/al2023-headless/Dockerfile b/17/headless/al2023-headless/Dockerfile new file mode 100644 index 0000000..ed07d1c --- /dev/null +++ b/17/headless/al2023-headless/Dockerfile @@ -0,0 +1,24 @@ +FROM amazonlinux:2023 + +ARG version=17.0.10.7.1 +ARG package_version=1 + +RUN set -eux \ + && rpm --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2023 \ + && echo "localpkg_gpgcheck=1" >> /etc/dnf/dnf.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + && RPM_LIST=("java-17-amazon-corretto-headless-$version.amzn2023.${package_version}.$(uname -m).rpm") \ + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/$(echo $version | tr '-' '.')/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: digests signatures OK" || exit 1; \ + done \ + && dnf install -y ${CORRETO_TEMP}/*.rpm \ + && popd \ + && rm -rf /usr/lib/jvm/java-17-amazon-corretto.$(uname -m)/lib/src.zip \ + && rm -rf ${CORRETO_TEMP} \ + && dnf clean all \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/dnf/dnf.conf + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto \ No newline at end of file diff --git a/17/jdk/al2-generic/Dockerfile b/17/jdk/al2-generic/Dockerfile index a3297aa..7074728 100644 --- a/17/jdk/al2-generic/Dockerfile +++ b/17/jdk/al2-generic/Dockerfile @@ -1,6 +1,6 @@ FROM amazonlinux:2 -ARG version=17.0.10.7-1 +ARG version=17.0.10.7.1 # In addition to installing the Amazon corretto, we also install # fontconfig. The folks who manage the docker hub's # official image library have found that font management @@ -29,4 +29,4 @@ RUN set -eux \ && yum clean all ENV LANG C.UTF-8 -ENV JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto +ENV JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto \ No newline at end of file diff --git a/17/jdk/al2/Dockerfile b/17/jdk/al2/Dockerfile index 9185cd2..c5c525e 100644 --- a/17/jdk/al2/Dockerfile +++ b/17/jdk/al2/Dockerfile @@ -1,6 +1,6 @@ FROM amazonlinux:2 -ARG version=17.0.10.7-1 +ARG version=17.0.10.7.1 RUN set -eux \ && export resouce_version=$(echo $version | tr '-' '.') \ @@ -15,7 +15,7 @@ RUN set -eux \ && if [[ ${rpm} != *jmods* ]]; then \ yum install -y $(yum deplist "${CORRETO_TEMP}/${rpm}" |grep provider | grep -vE "log4j-cve|corretto" | tr -s ' ' |cut -d ' ' -f 3 ); \ fi; \ - done \ + done \ && rpm -i --nodeps ${CORRETO_TEMP}/*.rpm \ && popd \ && (find /usr/lib/jvm/java-17-amazon-corretto.$(uname -m) -name src.zip -delete || true) \ diff --git a/17/jdk/al2023/Dockerfile b/17/jdk/al2023/Dockerfile index a125cf1..a0d4067 100644 --- a/17/jdk/al2023/Dockerfile +++ b/17/jdk/al2023/Dockerfile @@ -1,6 +1,6 @@ FROM amazonlinux:2023 -ARG version=17.0.10.7-1 +ARG version=17.0.10.7.1 ARG package_version=1 RUN set -eux \ @@ -21,4 +21,4 @@ RUN set -eux \ && sed -i '/localpkg_gpgcheck=1/d' /etc/dnf/dnf.conf ENV LANG C.UTF-8 -ENV JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto +ENV JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto \ No newline at end of file diff --git a/21/jdk/al2-generic/Dockerfile b/21/jdk/al2-generic/Dockerfile index 20556f1..9cb7d45 100644 --- a/21/jdk/al2-generic/Dockerfile +++ b/21/jdk/al2-generic/Dockerfile @@ -1,6 +1,6 @@ FROM amazonlinux:2 -ARG version=21.0.2.13-1 +ARG version=21.0.2.13.1 # In addition to installing the Amazon corretto, we also install # fontconfig. The folks who manage the docker hub's # official image library have found that font management @@ -29,4 +29,4 @@ RUN set -eux \ && yum clean all ENV LANG C.UTF-8 -ENV JAVA_HOME=/usr/lib/jvm/java-21-amazon-corretto +ENV JAVA_HOME=/usr/lib/jvm/java-21-amazon-corretto \ No newline at end of file diff --git a/21/jdk/al2/Dockerfile b/21/jdk/al2/Dockerfile new file mode 100644 index 0000000..13ce6da --- /dev/null +++ b/21/jdk/al2/Dockerfile @@ -0,0 +1,28 @@ +FROM amazonlinux:2 + +ARG version=21.0.2.13.1 + +RUN set -eux \ + && export resouce_version=$(echo $version | tr '-' '.') \ + && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2 \ + && echo "localpkg_gpgcheck=1" >> /etc/yum.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + && RPM_LIST=("java-21-amazon-corretto-headless-$version.amzn2.1.$(uname -m).rpm" "java-21-amazon-corretto-$version.amzn2.1.$(uname -m).rpm" "java-21-amazon-corretto-devel-$version.amzn2.1.$(uname -m).rpm" "java-21-amazon-corretto-jmods-$version.amzn2.1.$(uname -m).rpm") \ + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/${resouce_version}/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: rsa sha1 (md5) pgp md5 OK" || exit 1 \ + && if [[ ${rpm} != *jmods* ]]; then \ + yum install -y $(yum deplist "${CORRETO_TEMP}/${rpm}" |grep provider | grep -vE "log4j-cve|corretto" | tr -s ' ' |cut -d ' ' -f 3 ); \ + fi; \ + done \ + && rpm -i --nodeps ${CORRETO_TEMP}/*.rpm \ + && popd \ + && (find /usr/lib/jvm/java-21-amazon-corretto.$(uname -m) -name src.zip -delete || true) \ + && rm -rf ${CORRETO_TEMP} \ + && yum clean all \ + && rm -rf /var/cache/yum \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/yum.conf + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-21-amazon-corretto \ No newline at end of file diff --git a/21/jdk/al2023/Dockerfile b/21/jdk/al2023/Dockerfile index 12fe6a1..ceb141a 100644 --- a/21/jdk/al2023/Dockerfile +++ b/21/jdk/al2023/Dockerfile @@ -1,6 +1,6 @@ FROM amazonlinux:2023 -ARG version=21.0.2.13-1 +ARG version=21.0.2.13.1 ARG package_version=1 RUN set -eux \ @@ -21,4 +21,4 @@ RUN set -eux \ && sed -i '/localpkg_gpgcheck=1/d' /etc/dnf/dnf.conf ENV LANG C.UTF-8 -ENV JAVA_HOME=/usr/lib/jvm/java-21-amazon-corretto +ENV JAVA_HOME=/usr/lib/jvm/java-21-amazon-corretto \ No newline at end of file diff --git a/8/jdk/al2-generic/Dockerfile b/8/jdk/al2-generic/Dockerfile index 44e8660..1da4de2 100644 --- a/8/jdk/al2-generic/Dockerfile +++ b/8/jdk/al2-generic/Dockerfile @@ -1,6 +1,6 @@ FROM amazonlinux:2 -ARG version=1.8.0_402.b08-1 +ARG version=1.8.0 # In addition to installing the Amazon corretto, we also install # fontconfig. The folks who manage the docker hub's # official image library have found that font management diff --git a/8/jdk/al2/Dockerfile b/8/jdk/al2/Dockerfile index e5a17d4..db70b1b 100644 --- a/8/jdk/al2/Dockerfile +++ b/8/jdk/al2/Dockerfile @@ -1,7 +1,6 @@ FROM amazonlinux:2 -ARG version=1.8.0_402.b08-1 - +ARG version=1.8.0 RUN set -eux \ && export resouce_version=$(echo $version | tr '-' '.' | tr '_' '.'| tr -d "b" | awk -F. '{print $2"."$4"."$5"."$6}') \ @@ -24,4 +23,4 @@ RUN set -eux \ && sed -i '/localpkg_gpgcheck=1/d' /etc/yum.conf ENV LANG C.UTF-8 -ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto +ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto \ No newline at end of file diff --git a/8/jdk/al2023/Dockerfile b/8/jdk/al2023/Dockerfile index ca5f453..2dbbed6 100644 --- a/8/jdk/al2023/Dockerfile +++ b/8/jdk/al2023/Dockerfile @@ -1,7 +1,6 @@ FROM amazonlinux:2023 -ARG version=1.8.0_402.b08-1 - +ARG version=1.8.0 RUN set -eux \ && export resouce_version=$(echo $version | tr '-' '.' | tr '_' '.'| tr -d "b" | awk -F. '{print $2"."$4"."$5"."$6}') \ @@ -11,7 +10,7 @@ RUN set -eux \ && pushd ${CORRETO_TEMP} \ && RPM_LIST=("java-1.8.0-amazon-corretto-$version.amzn2023.$(uname -m).rpm" "java-1.8.0-amazon-corretto-devel-$version.amzn2023.$(uname -m).rpm") \ && for rpm in ${RPM_LIST[@]}; do \ - curl --fail -O https://corretto.aws/downloads/resources/${resouce_version}/${rpm} \ + curl --fail -O https://corretto.aws/downloads/resources/$(echo $version | tr '-' '.')/${rpm} \ && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: digests signatures OK" || exit 1; \ done \ && dnf install -y ${CORRETO_TEMP}/*.rpm \ @@ -23,4 +22,4 @@ RUN set -eux \ && sed -i '/localpkg_gpgcheck=1/d' /etc/dnf/dnf.conf ENV LANG C.UTF-8 -ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto +ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto \ No newline at end of file diff --git a/8/jre/al2/Dockerfile b/8/jre/al2/Dockerfile index 3af7644..c5f6cc9 100644 --- a/8/jre/al2/Dockerfile +++ b/8/jre/al2/Dockerfile @@ -1,7 +1,6 @@ FROM amazonlinux:2 -ARG version=1.8.0_402.b08-1 - +ARG version=1.8.0 RUN set -eux \ && export resouce_version=$(echo $version | tr '-' '.' | tr '_' '.'| tr -d "b" | awk -F. '{print $2"."$4"."$5"."$6}') \ @@ -13,16 +12,16 @@ RUN set -eux \ && for rpm in ${RPM_LIST[@]}; do \ curl --fail -O https://corretto.aws/downloads/resources/${resouce_version}/${rpm} \ && echo $(rpm -K "${CORRETO_TEMP}/${rpm}") \ - && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: rsa sha1 (md5) pgp md5 OK" || exit 1; \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: rsa sha1 (md5) pgp md5 OK" || exit 1 \ done \ - && yum install -y $(yum deplist ${CORRETO_TEMP}/*.rpm |grep provider | grep -v log4j-cve | tr -s ' ' |cut -d ' ' -f 3 ) \ + && yum install -y $(yum deplist "${CORRETO_TEMP}/${rpm}" |grep provider | grep -v log4j-cve | tr -s ' ' |cut -d ' ' -f 3 ); \ && rpm -i --nodeps ${CORRETO_TEMP}/*.rpm \ && popd \ - && rm -rf /usr/lib/jvm/java-1.8.0-amazon-corretto.$(uname -m)/lib/src.zip \ + && (find /usr/lib/jvm/java-1.8.0-amazon-corretto.$(uname -m) -name "*src.zip" -delete || true) \ && rm -rf ${CORRETO_TEMP} \ && yum clean all \ && rm -rf /var/cache/yum \ && sed -i '/localpkg_gpgcheck=1/d' /etc/yum.conf ENV LANG C.UTF-8 -ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto/jre +ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto/jre \ No newline at end of file diff --git a/8/jre/al2023/Dockerfile b/8/jre/al2023/Dockerfile index 5efc4a3..1d1fda0 100644 --- a/8/jre/al2023/Dockerfile +++ b/8/jre/al2023/Dockerfile @@ -1,6 +1,6 @@ FROM amazonlinux:2023 -ARG version=1.8.0_402.b08-1 +ARG version=1.8.0 RUN set -eux \ && export resouce_version=$(echo $version | tr '-' '.' | tr '_' '.'| tr -d "b" | awk -F. '{print $2"."$4"."$5"."$6}') \ @@ -10,7 +10,7 @@ RUN set -eux \ && pushd ${CORRETO_TEMP} \ && RPM_LIST=("java-1.8.0-amazon-corretto-$version.amzn2023.$(uname -m).rpm") \ && for rpm in ${RPM_LIST[@]}; do \ - curl --fail -O https://corretto.aws/downloads/resources/${resouce_version}/${rpm} \ + curl --fail -O https://corretto.aws/downloads/resources/$(echo $version | tr '-' '.')/${rpm} \ && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: digests signatures OK" || exit 1; \ done \ && dnf install -y ${CORRETO_TEMP}/*.rpm \ @@ -22,4 +22,4 @@ RUN set -eux \ && sed -i '/localpkg_gpgcheck=1/d' /etc/dnf/dnf.conf ENV LANG C.UTF-8 -ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto/jre +ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto/jre \ No newline at end of file diff --git a/bin/apply-template.py b/bin/apply-template.py index 36ca4c2..4accadd 100644 --- a/bin/apply-template.py +++ b/bin/apply-template.py @@ -9,6 +9,8 @@ def process_template_files(major_version, version, platform): template = templateEnv.get_template(f"{platform}.Dockerfile.template") input_parameter = {} + if major_version == '8' and platform!= 'alpine': + version = '1.8.0' input_parameter['CORRETTO_VERSION'] = version input_parameter['MAJOR_VERSION'] = major_version if platform == 'alpine': @@ -19,17 +21,46 @@ def process_template_files(major_version, version, platform): shutil.rmtree(f"{major_version}/jre/{platform}") except: pass - for os_version in os_versions: - input_parameter['OS_VERSION'] = os_version - os.makedirs(f"{major_version}/jdk/{platform}/{os_version}/", exist_ok=True) - with open(f"{major_version}/jdk/{platform}/{os_version}/Dockerfile", 'w') as output: - output.write(template.render(**input_parameter)) + if platform == 'alpine': + for os_version in os_versions: + input_parameter['OS_VERSION'] = os_version + os.makedirs(f"{major_version}/jdk/{platform}/{os_version}/", exist_ok=True) + with open(f"{major_version}/jdk/{platform}/{os_version}/Dockerfile", 'w') as output: + output.write(template.render(**input_parameter)) + + if major_version == '8': + os.makedirs(f"{major_version}/jre/{platform}/{os_version}/", exist_ok=True) + with open(f"{major_version}/jre/{platform}/{os_version}/Dockerfile", 'w') as output: + output.write(template.render(**input_parameter, **{'jre':True})) + + elif 'headless' in platform or 'headful' in platform: + head_variant = 'headless' if 'headless' in platform else 'headful' + if major_version=='11' or major_version=='17': + os.makedirs(f"{major_version}/{head_variant}/{platform}/", exist_ok=True) + with open(f"{major_version}/{head_variant}/{platform}/Dockerfile", 'w') as output: + output.write(template.render(**input_parameter)) + + elif platform == 'al2023-generic': + if major_version=='20': + os.makedirs(f"{major_version}/jdk/{platform}/", exist_ok=True) + with open(f"{major_version}/jdk/{platform}/Dockerfile", 'w') as output: + output.write(template.render(**input_parameter)) + + else: + os.makedirs(f"{major_version}/jdk/{platform}/", exist_ok=True) + with open(f"{major_version}/jdk/{platform}/Dockerfile", 'w') as output: + if major_version == '8': + output.write(template.render(**input_parameter, **{'version_8':True})) + elif major_version == '11': + output.write(template.render(**input_parameter, **{'version_11':True})) + else: + output.write(template.render(**input_parameter)) + + if major_version == '8' and platform != 'al2-generic': + os.makedirs(f"{major_version}/jre/{platform}/", exist_ok=True) + with open(f"{major_version}/jre/{platform}/Dockerfile", 'w') as output: + output.write(template.render(**input_parameter, **{'jre':True, 'version_8':True})) - - if major_version == '8': - os.makedirs(f"{major_version}/jre/{platform}/{os_version}/", exist_ok=True) - with open(f"{major_version}/jre/{platform}/{os_version}/Dockerfile", 'w') as output: - output.write(template.render(**input_parameter, **{'jre':True})) def main(): with open('versions.json','r') as version_file: @@ -37,6 +68,14 @@ def main(): for key in versions: process_template_files(key, versions[key], 'alpine') + process_template_files(key, versions[key], 'al2') + process_template_files(key, versions[key], 'al2-generic') + process_template_files(key, versions[key], 'al2-headful') + process_template_files(key, versions[key], 'al2-headless') + process_template_files(key, versions[key], 'al2023') + process_template_files(key, versions[key], 'al2023-generic') + process_template_files(key, versions[key], 'al2023-headful') + process_template_files(key, versions[key], 'al2023-headless') if __name__ == "__main__": main() diff --git a/templates/al2-generic.Dockerfile.template b/templates/al2-generic.Dockerfile.template new file mode 100644 index 0000000..0ca6b99 --- /dev/null +++ b/templates/al2-generic.Dockerfile.template @@ -0,0 +1,35 @@ +FROM amazonlinux:2 + +ARG version={{CORRETTO_VERSION}} +# In addition to installing the Amazon corretto, we also install +# fontconfig. The folks who manage the docker hub's +# official image library have found that font management +# is a common usecase, and painpoint, and have +# recommended that Java images include font support. +# +# See: +# https://github.com/docker-library/official-images/blob/master/test/tests/java-uimanager-font/container.java + +# The logic and code related to Fingerprint is contributed by @tianon in a Github PR's Conversation +# Comment = https://github.com/docker-library/official-images/pull/7459#issuecomment-592242757 +# PR = https://github.com/docker-library/official-images/pull/7459 +RUN set -eux \ + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fL -o corretto.key https://yum.corretto.aws/corretto.key \ + && gpg --batch --import corretto.key \ + && gpg --batch --export --armor '6DC3636DAE534049C8B94623A122542AB04F24E3' > corretto.key \ + && rpm --import corretto.key \ + && rm -r "$GNUPGHOME" corretto.key \ + && curl -fL -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo \ + && grep -q '^gpgcheck=1' /etc/yum.repos.d/corretto.repo \ + && echo "priority=9" >> /etc/yum.repos.d/corretto.repo \{% if version_8 %} + && yum install -y java-{{CORRETTO_VERSION}}-amazon-corretto-devel-$version \ + && (find /usr/lib/jvm/java-{{CORRETTO_VERSION}}-amazon-corretto -name src.zip -delete || true) \{% else %} + && yum install -y java-{{MAJOR_VERSION}}-amazon-corretto-devel-$version \ + && (find /usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto -name src.zip -delete || true) \{% endif %} + && yum install -y fontconfig \ + && yum clean all + +ENV LANG C.UTF-8 +{% if version_8 %}ENV JAVA_HOME=/usr/lib/jvm/java-{{CORRETTO_VERSION}}-amazon-corretto +{% else %}ENV JAVA_HOME=/usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto{% endif %} diff --git a/templates/al2-headful.Dockerfile.template b/templates/al2-headful.Dockerfile.template new file mode 100644 index 0000000..eb896b8 --- /dev/null +++ b/templates/al2-headful.Dockerfile.template @@ -0,0 +1,26 @@ +FROM amazonlinux:2 + +ARG version={{CORRETTO_VERSION}} + +RUN set -eux \ + && export resouce_version=$(echo $version | tr '-' '.') \ + && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2 \ + && echo "localpkg_gpgcheck=1" >> /etc/yum.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + && RPM_LIST=("java-{{MAJOR_VERSION}}-amazon-corretto-headless-$version.amzn2.1.$(uname -m).rpm" "java-{{MAJOR_VERSION}}-amazon-corretto-$version.amzn2.1.$(uname -m).rpm") \ + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/${resouce_version}/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: rsa sha1 (md5) pgp md5 OK" || exit 1 \ + && yum install -y $(yum deplist "${CORRETO_TEMP}/${rpm}" |grep provider | grep -vE "log4j-cve|corretto" | tr -s ' ' |cut -d ' ' -f 3 ); \ + done \ + && rpm -i --nodeps ${CORRETO_TEMP}/*.rpm \ + && popd \ + && (find /usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto.$(uname -m) -name src.zip -delete || true) \ + && rm -rf ${CORRETO_TEMP} \ + && yum clean all \ + && rm -rf /var/cache/yum \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/yum.conf + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto diff --git a/templates/al2-headless.Dockerfile.template b/templates/al2-headless.Dockerfile.template new file mode 100644 index 0000000..008de20 --- /dev/null +++ b/templates/al2-headless.Dockerfile.template @@ -0,0 +1,26 @@ +FROM amazonlinux:2 + +ARG version={{CORRETTO_VERSION}} + +RUN set -eux \ + && export resouce_version=$(echo $version | tr '-' '.') \ + && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2 \ + && echo "localpkg_gpgcheck=1" >> /etc/yum.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + && RPM_LIST=("java-{{MAJOR_VERSION}}-amazon-corretto-headless-$version.amzn2.1.$(uname -m).rpm") \ + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/${resouce_version}/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: rsa sha1 (md5) pgp md5 OK" || exit 1 \ + && yum install -y $(yum deplist "${CORRETO_TEMP}/${rpm}" |grep provider | grep -vE "log4j-cve|corretto" | tr -s ' ' |cut -d ' ' -f 3 ); \ + done \ + && rpm -i --nodeps ${CORRETO_TEMP}/*.rpm \ + && popd \ + && (find /usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto.$(uname -m) -name src.zip -delete || true) \ + && rm -rf ${CORRETO_TEMP} \ + && yum clean all \ + && rm -rf /var/cache/yum \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/yum.conf + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto diff --git a/templates/al2.Dockerfile.template b/templates/al2.Dockerfile.template new file mode 100644 index 0000000..0699aa1 --- /dev/null +++ b/templates/al2.Dockerfile.template @@ -0,0 +1,31 @@ +FROM amazonlinux:2 + +ARG version={{CORRETTO_VERSION}} + +RUN set -eux \ + {%if version_8 %}&& export resouce_version=$(echo $version | tr '-' '.' | tr '_' '.'| tr -d "b" | awk -F. '{print $2"."$4"."$5"."$6}') \{% else %}&& export resouce_version=$(echo $version | tr '-' '.') \{% endif %} + && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2 \ + && echo "localpkg_gpgcheck=1" >> /etc/yum.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + {% if jre %}&& RPM_LIST=("java-{{CORRETTO_VERSION}}-amazon-corretto-$version.amzn2.$(uname -m).rpm") \{% elif version_8 %}&& RPM_LIST=("java-{{CORRETTO_VERSION}}-amazon-corretto-$version.amzn2.$(uname -m).rpm" "java-{{CORRETTO_VERSION}}-amazon-corretto-devel-$version.amzn2.$(uname -m).rpm") \{% elif version_11 %}&& RPM_LIST=("java-{{MAJOR_VERSION}}-amazon-corretto-headless-$version.amzn2.$(uname -m).rpm" "java-{{MAJOR_VERSION}}-amazon-corretto-$version.amzn2.$(uname -m).rpm") \{% else %}&& RPM_LIST=("java-{{MAJOR_VERSION}}-amazon-corretto-headless-$version.amzn2.1.$(uname -m).rpm" "java-{{MAJOR_VERSION}}-amazon-corretto-$version.amzn2.1.$(uname -m).rpm" "java-{{MAJOR_VERSION}}-amazon-corretto-devel-$version.amzn2.1.$(uname -m).rpm" "java-{{MAJOR_VERSION}}-amazon-corretto-jmods-$version.amzn2.1.$(uname -m).rpm") \{% endif %} + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/${resouce_version}/${rpm} \{% if jre %} + && echo $(rpm -K "${CORRETO_TEMP}/${rpm}") \{% endif %} + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: rsa sha1 (md5) pgp md5 OK" || exit 1 \{% if jre %} + done \{% endif %}{% if version_8 %} + && yum install -y $(yum deplist "${CORRETO_TEMP}/${rpm}" |grep provider | grep -v log4j-cve | tr -s ' ' |cut -d ' ' -f 3 ); \{% else %} + && if [[ ${rpm} != *jmods* ]]; then \ + yum install -y $(yum deplist "${CORRETO_TEMP}/${rpm}" |grep provider | grep -vE "log4j-cve|corretto" | tr -s ' ' |cut -d ' ' -f 3 ); \ + fi; \{% endif %}{% if not jre %} + done \{% endif %} + && rpm -i --nodeps ${CORRETO_TEMP}/*.rpm \ + && popd \ + {%if version_8 %}&& (find /usr/lib/jvm/java-{{CORRETTO_VERSION}}-amazon-corretto.$(uname -m) -name "*src.zip" -delete || true) \{% else %}&& (find /usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto.$(uname -m) -name src.zip -delete || true) \{% endif %} + && rm -rf ${CORRETO_TEMP} \ + && yum clean all \ + && rm -rf /var/cache/yum \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/yum.conf + +ENV LANG C.UTF-8 +{%if jre %}ENV JAVA_HOME=/usr/lib/jvm/java-{{CORRETTO_VERSION}}-amazon-corretto/jre{% elif version_8 %}ENV JAVA_HOME=/usr/lib/jvm/java-{{CORRETTO_VERSION}}-amazon-corretto{% else %}ENV JAVA_HOME=/usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto{% endif %} diff --git a/templates/al2023-generic.Dockerfile.template b/templates/al2023-generic.Dockerfile.template new file mode 100644 index 0000000..5e23d89 --- /dev/null +++ b/templates/al2023-generic.Dockerfile.template @@ -0,0 +1,29 @@ +FROM amazonlinux:2023 + +ARG version={{CORRETTO_VERSION}} +# In addition to installing the Amazon corretto, we also install +# libs that are needed for jdk to be functional + +# The logic and code related to Fingerprint is contributed by @tianon in a Github PR's Conversation +# Comment = https://github.com/docker-library/official-images/pull/7459#issuecomment-592242757 +# PR = https://github.com/docker-library/official-images/pull/7459 +RUN set -eux \ + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fL -o corretto.key https://yum.corretto.aws/corretto.key \ + && dnf install gnupg2 -y --allowerasing \ + && dnf install findutils -y \ + && gpg --batch --import corretto.key \ + && gpg --batch --export --armor '6DC3636DAE534049C8B94623A122542AB04F24E3' > corretto.key \ + && rpm --import corretto.key \ + && rm -r "$GNUPGHOME" corretto.key \ + && curl -fL -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo \ + && grep -q '^gpgcheck=1' /etc/yum.repos.d/corretto.repo \ + && echo "priority=9" >> /etc/yum.repos.d/corretto.repo \ + && dnf install -y java-{{MAJOR_VERSION}}-amazon-corretto-devel-$version \ + && (find /usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto -name src.zip -delete || true) \ + && dnf remove -y findutils \ + && dnf install -y fontconfig freetype libjpeg dejavu-sans-fonts dejavu-serif-fonts dejavu-sans-mono-fonts libjpeg \ + && dnf clean all + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto diff --git a/templates/al2023-headful.Dockerfile.template b/templates/al2023-headful.Dockerfile.template new file mode 100644 index 0000000..ea5f5af --- /dev/null +++ b/templates/al2023-headful.Dockerfile.template @@ -0,0 +1,24 @@ +FROM amazonlinux:2023 + +ARG version={{CORRETTO_VERSION}} +ARG package_version=1 + +RUN set -eux \ + && rpm --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2023 \ + && echo "localpkg_gpgcheck=1" >> /etc/dnf/dnf.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + && RPM_LIST=("java-{{MAJOR_VERSION}}-amazon-corretto-headless-$version.amzn2023.${package_version}.$(uname -m).rpm" "java-{{MAJOR_VERSION}}-amazon-corretto-$version.amzn2023.${package_version}.$(uname -m).rpm") \ + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/$(echo $version | tr '-' '.')/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: digests signatures OK" || exit 1; \ + done \ + && dnf install -y ${CORRETO_TEMP}/*.rpm \ + && popd \ + && rm -rf /usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto.$(uname -m)/lib/src.zip \ + && rm -rf ${CORRETO_TEMP} \ + && dnf clean all \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/dnf/dnf.conf + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto diff --git a/templates/al2023-headless.Dockerfile.template b/templates/al2023-headless.Dockerfile.template new file mode 100644 index 0000000..a8736f1 --- /dev/null +++ b/templates/al2023-headless.Dockerfile.template @@ -0,0 +1,24 @@ +FROM amazonlinux:2023 + +ARG version={{CORRETTO_VERSION}} +ARG package_version=1 + +RUN set -eux \ + && rpm --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2023 \ + && echo "localpkg_gpgcheck=1" >> /etc/dnf/dnf.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \ + && RPM_LIST=("java-{{MAJOR_VERSION}}-amazon-corretto-headless-$version.amzn2023.${package_version}.$(uname -m).rpm") \ + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/$(echo $version | tr '-' '.')/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: digests signatures OK" || exit 1; \ + done \ + && dnf install -y ${CORRETO_TEMP}/*.rpm \ + && popd \ + && rm -rf /usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto.$(uname -m)/lib/src.zip \ + && rm -rf ${CORRETO_TEMP} \ + && dnf clean all \ + && sed -i '/localpkg_gpgcheck=1/d' /etc/dnf/dnf.conf + +ENV LANG C.UTF-8 +ENV JAVA_HOME=/usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto diff --git a/templates/al2023.Dockerfile.template b/templates/al2023.Dockerfile.template new file mode 100644 index 0000000..f790f1c --- /dev/null +++ b/templates/al2023.Dockerfile.template @@ -0,0 +1,30 @@ +FROM amazonlinux:2023 + +ARG version={{CORRETTO_VERSION}}{% if not version_8 %} +ARG package_version=1{% endif %} + +RUN set -eux \{%if version_8 %} + && export resouce_version=$(echo $version | tr '-' '.' | tr '_' '.'| tr -d "b" | awk -F. '{print $2"."$4"."$5"."$6}') \{% endif %} + && rpm --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-linux-2023 \ + && echo "localpkg_gpgcheck=1" >> /etc/dnf/dnf.conf \ + && CORRETO_TEMP=$(mktemp -d) \ + && pushd ${CORRETO_TEMP} \{% if jre %} + && RPM_LIST=("java-{{CORRETTO_VERSION}}-amazon-corretto-$version.amzn2023.$(uname -m).rpm") \{% elif version_8 %} + && RPM_LIST=("java-{{CORRETTO_VERSION}}-amazon-corretto-$version.amzn2023.$(uname -m).rpm" "java-{{CORRETTO_VERSION}}-amazon-corretto-devel-$version.amzn2023.$(uname -m).rpm") \{% else %} + && RPM_LIST=("java-{{MAJOR_VERSION}}-amazon-corretto-headless-$version.amzn2023.${package_version}.$(uname -m).rpm" "java-{{MAJOR_VERSION}}-amazon-corretto-$version.amzn2023.${package_version}.$(uname -m).rpm" "java-{{MAJOR_VERSION}}-amazon-corretto-devel-$version.amzn2023.${package_version}.$(uname -m).rpm" "java-{{MAJOR_VERSION}}-amazon-corretto-jmods-$version.amzn2023.${package_version}.$(uname -m).rpm") \{% endif %} + && for rpm in ${RPM_LIST[@]}; do \ + curl --fail -O https://corretto.aws/downloads/resources/$(echo $version | tr '-' '.')/${rpm} \ + && rpm -K "${CORRETO_TEMP}/${rpm}" | grep -F "${CORRETO_TEMP}/${rpm}: digests signatures OK" || exit 1; \ + done \ + && dnf install -y ${CORRETO_TEMP}/*.rpm \{% if jre %} + && alternatives --install /usr/lib/jvm/java-{{CORRETTO_VERSION}}-amazon-corretto java-{{CORRETTO_VERSION}}-amazon-corretto /usr/lib/jvm/java-{{CORRETTO_VERSION}}-amazon-corretto.$(uname -m) 100 \{% endif %} + && popd \{%if version_8 %} + && rm -rf /usr/lib/jvm/java-{{CORRETTO_VERSION}}-amazon-corretto.$(uname -m)/lib/src.zip \{% else %} + && rm -rf /usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto.$(uname -m)/lib/src.zip \{% endif %} + && rm -rf ${CORRETO_TEMP} \ + && dnf clean all \{% if version_8 and not jre%} + && rm -rf /var/cache/yum \{% endif %} + && sed -i '/localpkg_gpgcheck=1/d' /etc/dnf/dnf.conf + +ENV LANG C.UTF-8 +{% if jre %}ENV JAVA_HOME=/usr/lib/jvm/java-{{CORRETTO_VERSION}}-amazon-corretto/jre{% elif version_8 %}ENV JAVA_HOME=/usr/lib/jvm/java-{{CORRETTO_VERSION}}-amazon-corretto{% else %}ENV JAVA_HOME=/usr/lib/jvm/java-{{MAJOR_VERSION}}-amazon-corretto{% endif %}