From 97b425c4f4afaac5ee256ec1127ee1c14924001b Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Sun, 6 Oct 2024 11:14:37 -0600 Subject: [PATCH] Remove Java 11 support (#1937) * Test LTS with 2.462.3 * Switch default build version to 2.479 * Remove Java 11 support Jenkins weekly stopped supporting Java 11 with 2.463 https://www.jenkins.io/changelog/2.463/ Jenkins LTS stops Java 11 support with 2.479.1 30 Oct 2024 No longer generates container images for: * AlmaLinux * Alpine JDK 11 * Debian JDK 11 * Debian slim JDK 11 * Red Hat Universal Base Image 8 * Windows Server Core LTSC 2019 JDK 11 Move -strip-java-debug-attributes into jlink command line Conditional no longer needed for that argument Best reviewed with white space differences suppressed. Tested with `make build test` on two different machines. Confirmed the list of generated container images does not include any Java 11 container, does not include any UBI 8 container, and does not include any AlmaLinux container. * Simplify docker compose in Windows * Use correct debug attribute strip on Windows --- .ci/publish.sh | 11 +- .github/workflows/sync-plugin-manager.yml | 2 +- Jenkinsfile | 378 +++++++++---------- Makefile | 7 +- almalinux/almalinux8/hotspot/Dockerfile | 144 ------- alpine/hotspot/Dockerfile | 12 +- build-windows-lts-with-jdk11.yaml | 50 --- debian/bookworm-slim/hotspot/Dockerfile | 12 +- debian/bookworm/hotspot/Dockerfile | 12 +- docker-bake.hcl | 130 +------ make.ps1 | 11 +- rhel/ubi8/hotspot/Dockerfile | 147 -------- rhel/ubi9/hotspot/Dockerfile | 12 +- updatecli/scripts/check-jdk.sh | 13 - updatecli/updatecli.d/jdk11.yaml | 99 ----- updatecli/updatecli.d/jdk17.yaml | 1 - updatecli/updatecli.d/jdk21.yaml | 1 - windows/windowsservercore/hotspot/Dockerfile | 9 +- 18 files changed, 201 insertions(+), 850 deletions(-) delete mode 100644 almalinux/almalinux8/hotspot/Dockerfile delete mode 100644 build-windows-lts-with-jdk11.yaml delete mode 100644 rhel/ubi8/hotspot/Dockerfile delete mode 100644 updatecli/updatecli.d/jdk11.yaml diff --git a/.ci/publish.sh b/.ci/publish.sh index df5fbb5030..37b20a82ee 100755 --- a/.ci/publish.sh +++ b/.ci/publish.sh @@ -68,15 +68,9 @@ else LATEST_WEEKLY="false" fi -# Build all images including Java 11 if the version match latest LTS version -# TODO: remove when Java 11 is removed from LTS line -# See https://github.com/jenkinsci/docker/issues/1890 -TARGET="linux" - if [[ "${JENKINS_VERSION}" == "${latest_lts_version}" ]] then LATEST_LTS="true" - TARGET="linux-lts-with-jdk11" else LATEST_LTS="false" fi @@ -90,7 +84,7 @@ fi JENKINS_SHA="$(curl --disable --fail --silent --show-error --location "https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war.sha256")" COMMIT_SHA=$(git rev-parse HEAD) -export COMMIT_SHA JENKINS_VERSION JENKINS_SHA LATEST_WEEKLY LATEST_LTS TARGET +export COMMIT_SHA JENKINS_VERSION JENKINS_SHA LATEST_WEEKLY LATEST_LTS cat <> $GITHUB_OUTPUT else diff --git a/Jenkinsfile b/Jenkinsfile index bd733268f9..7478653abf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,9 +22,9 @@ def SIMULATE_LTS_BUILD = false if (SIMULATE_LTS_BUILD) { envVars = [ "PUBLISH=false", - "TAG_NAME=2.452.2", - "JENKINS_VERSION=2.452.2", - "JENKINS_SHA=360efc8438db9a4ba20772981d4257cfe6837bf0c3fb8c8e9b2253d8ce6ba339" + "TAG_NAME=2.462.3", + "JENKINS_VERSION=2.462.3", + "JENKINS_SHA=3e53b52a816405e3b10ad07f1c48cd0cb5cb3f893207ef7f9de28415806b93c1" ] } @@ -32,211 +32,173 @@ stage('Build') { def builds = [:] withEnv (envVars) { - // Determine if the tag name (ie Jenkins version) correspond to a LTS (3 groups of digits) - // to use the appropriate bake target and set of images to build (including or not Java 11) - def isLTS - if (env.TAG_NAME && env.TAG_NAME =~ /^\d+\.\d+\.\d+$/) { - isLTS = true - target = 'linux-lts-with-jdk11' - } else { - isLTS = false - target = 'linux' - } - echo "= bake target: $target" - echo "= isLTS: $isLTS" - - withEnv (["TARGET=${target}"]) { - def windowsImageTypes = [ - 'windowsservercore-ltsc2019', - ] - for (anImageType in windowsImageTypes) { - def imageType = anImageType - builds[imageType] = { - nodeWithTimeout('windows-2019') { - stage('Checkout') { - checkout scm - } - - withEnv(["IMAGE_TYPE=${imageType}"]) { - if (!infra.isTrusted()) { - /* Outside of the trusted.ci environment, we're building and testing - * the Dockerfile in this repository, but not publishing to docker hub - */ - stage("Build ${imageType}") { - infra.withDockerCredentials { - powershell './make.ps1' - } - } - - stage("Test ${imageType}") { - infra.withDockerCredentials { - def windowsTestStatus = powershell(script: './make.ps1 test', returnStatus: true) - junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results.xml') - if (windowsTestStatus > 0) { - // If something bad happened let's clean up the docker images - error('Windows test stage failed.') - } - } - } - - // disable until we get the parallel changes merged in - // def branchName = "${env.BRANCH_NAME}" - // if (branchName ==~ 'master'){ - // stage('Publish Experimental') { - // infra.withDockerCredentials { - // withEnv(['DOCKERHUB_ORGANISATION=jenkins4eval','DOCKERHUB_REPO=jenkins']) { - // powershell './make.ps1 publish' - // } - // } - // } - // } - } else { - // Only publish when a tag triggered the build & the publication is enabled (ie not simulating a LTS) - if (env.TAG_NAME && (env.PUBLISH == "true")) { - // Split to ensure any suffix is not taken in account (but allow suffix tags to trigger rebuilds) - jenkins_version = env.TAG_NAME.split('-')[0] - withEnv(["JENKINS_VERSION=${jenkins_version}"]) { - stage('Publish') { - infra.withDockerCredentials { - withEnv(['DOCKERHUB_ORGANISATION=jenkins','DOCKERHUB_REPO=jenkins']) { - powershell './make.ps1 publish' - } - } - } - } - } - } - } - } - } - } - - if (!infra.isTrusted()) { - def images - - def imagesWithoutJava11 = [ - 'alpine_jdk17', - 'alpine_jdk21', - 'debian_jdk17', - 'debian_jdk21', - 'debian_slim_jdk17', - 'debian_slim_jdk21', - 'rhel_ubi9_jdk17', - 'rhel_ubi9_jdk21', - ] - def imagesWithJava11 = [ - 'almalinux_jdk11', - 'alpine_jdk11', - 'alpine_jdk17', - 'alpine_jdk21', - 'debian_jdk11', - 'debian_jdk17', - 'debian_jdk21', - 'debian_slim_jdk11', - 'debian_slim_jdk17', - 'debian_slim_jdk21', - 'rhel_ubi8_jdk11', - 'rhel_ubi9_jdk17', - 'rhel_ubi9_jdk21', - ] - // Build all images including Java 11 if the version match a LTS versioning pattern - // TODO: remove when Java 11 is removed from LTS line - // See https://github.com/jenkinsci/docker/issues/1890 - if (isLTS) { - images = imagesWithJava11 - } else { - images = imagesWithoutJava11 - } - for (i in images) { - def imageToBuild = i - - builds[imageToBuild] = { - nodeWithTimeout('docker') { - deleteDir() - - stage('Checkout') { - checkout scm - } - - stage('Static analysis') { - sh 'make hadolint shellcheck' - } - - /* Outside of the trusted.ci environment, we're building and testing - * the Dockerfile in this repository, but not publishing to docker hub - */ - stage("Build linux-${imageToBuild}") { - infra.withDockerCredentials { - sh "make build-${imageToBuild}" - } - } - - stage("Test linux-${imageToBuild}") { - sh "make prepare-test" - try { - infra.withDockerCredentials { - sh "make test-${imageToBuild}" - } - } catch (err) { - error("${err.toString()}") - } finally { - junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/*.xml') - } - } - } - } - } - builds['multiarch-build'] = { - nodeWithTimeout('docker') { - stage('Checkout') { - deleteDir() - checkout scm - } - - // sanity check that proves all images build on declared platforms - stage('Multi arch build') { - infra.withDockerCredentials { - sh ''' - docker buildx create --use - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - docker buildx bake --file docker-bake.hcl "${TARGET}" - ''' - } - } - } - } - } else { - // Only publish when a tag triggered the build - if (env.TAG_NAME) { - // Split to ensure any suffix is not taken in account (but allow suffix tags to trigger rebuilds) - jenkins_version = env.TAG_NAME.split('-')[0] - builds['linux'] = { - withEnv(["JENKINS_VERSION=${jenkins_version}"]) { - nodeWithTimeout('docker') { - stage('Checkout') { - checkout scm - } - - stage('Publish') { - // Publication is enabled by default, disabled when simulating a LTS - if (env.PUBLISH == "true") { - infra.withDockerCredentials { - sh ''' - docker buildx create --use - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - make publish - ''' - } - } - } - } - } - } - } - } - - parallel builds - } + echo "= bake target: linux" + + def windowsImageTypes = [ + 'windowsservercore-ltsc2019', + ] + for (anImageType in windowsImageTypes) { + def imageType = anImageType + builds[imageType] = { + nodeWithTimeout('windows-2019') { + stage('Checkout') { + checkout scm + } + + withEnv(["IMAGE_TYPE=${imageType}"]) { + if (!infra.isTrusted()) { + /* Outside of the trusted.ci environment, we're building and testing + * the Dockerfile in this repository, but not publishing to docker hub + */ + stage("Build ${imageType}") { + infra.withDockerCredentials { + powershell './make.ps1' + } + } + + stage("Test ${imageType}") { + infra.withDockerCredentials { + def windowsTestStatus = powershell(script: './make.ps1 test', returnStatus: true) + junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results.xml') + if (windowsTestStatus > 0) { + // If something bad happened let's clean up the docker images + error('Windows test stage failed.') + } + } + } + + // disable until we get the parallel changes merged in + // def branchName = "${env.BRANCH_NAME}" + // if (branchName ==~ 'master'){ + // stage('Publish Experimental') { + // infra.withDockerCredentials { + // withEnv(['DOCKERHUB_ORGANISATION=jenkins4eval','DOCKERHUB_REPO=jenkins']) { + // powershell './make.ps1 publish' + // } + // } + // } + // } + } else { + // Only publish when a tag triggered the build & the publication is enabled (ie not simulating a LTS) + if (env.TAG_NAME && (env.PUBLISH == "true")) { + // Split to ensure any suffix is not taken in account (but allow suffix tags to trigger rebuilds) + jenkins_version = env.TAG_NAME.split('-')[0] + withEnv(["JENKINS_VERSION=${jenkins_version}"]) { + stage('Publish') { + infra.withDockerCredentials { + withEnv(['DOCKERHUB_ORGANISATION=jenkins','DOCKERHUB_REPO=jenkins']) { + powershell './make.ps1 publish' + } + } + } + } + } + } + } + } + } + } + + if (!infra.isTrusted()) { + def images = [ + 'alpine_jdk17', + 'alpine_jdk21', + 'debian_jdk17', + 'debian_jdk21', + 'debian_slim_jdk17', + 'debian_slim_jdk21', + 'rhel_ubi9_jdk17', + 'rhel_ubi9_jdk21', + ] + for (i in images) { + def imageToBuild = i + + builds[imageToBuild] = { + nodeWithTimeout('docker') { + deleteDir() + + stage('Checkout') { + checkout scm + } + + stage('Static analysis') { + sh 'make hadolint shellcheck' + } + + /* Outside of the trusted.ci environment, we're building and testing + * the Dockerfile in this repository, but not publishing to docker hub + */ + stage("Build linux-${imageToBuild}") { + infra.withDockerCredentials { + sh "make build-${imageToBuild}" + } + } + + stage("Test linux-${imageToBuild}") { + sh "make prepare-test" + try { + infra.withDockerCredentials { + sh "make test-${imageToBuild}" + } + } catch (err) { + error("${err.toString()}") + } finally { + junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/*.xml') + } + } + } + } + } + builds['multiarch-build'] = { + nodeWithTimeout('docker') { + stage('Checkout') { + deleteDir() + checkout scm + } + + // sanity check that proves all images build on declared platforms + stage('Multi arch build') { + infra.withDockerCredentials { + sh ''' + docker buildx create --use + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + docker buildx bake --file docker-bake.hcl linux + ''' + } + } + } + } + } else { + // Only publish when a tag triggered the build + if (env.TAG_NAME) { + // Split to ensure any suffix is not taken in account (but allow suffix tags to trigger rebuilds) + jenkins_version = env.TAG_NAME.split('-')[0] + builds['linux'] = { + withEnv(["JENKINS_VERSION=${jenkins_version}"]) { + nodeWithTimeout('docker') { + stage('Checkout') { + checkout scm + } + + stage('Publish') { + // Publication is enabled by default, disabled when simulating a LTS + if (env.PUBLISH == "true") { + infra.withDockerCredentials { + sh ''' + docker buildx create --use + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + make publish + ''' + } + } + } + } + } + } + } + } + + parallel builds } } diff --git a/Makefile b/Makefile index d169569058..8da9843a2f 100644 --- a/Makefile +++ b/Makefile @@ -21,11 +21,6 @@ DISABLE_PARALLEL_TESTS ?= false # default is "all test suites in the "tests/" directory TEST_SUITES ?= $(CURDIR)/tests -# Set to linux-lts-with-jdk11 to build all images including Java 11 if the version match a LTS versioning pattern -# TODO: remove when Java 11 is removed from LTS line -# See https://github.com/jenkinsci/docker/issues/1890 -TARGET ?= linux - ##### Macros ## Check the presence of a CLI in the current PATH check_cli = type "$(1)" >/dev/null 2>&1 || { echo "Error: command '$(1)' required but not found. Exiting." ; exit 1 ; } @@ -58,7 +53,7 @@ build-%: check-reqs @set -x; $(bake_base_cli) --set '*.platform=linux/$(ARCH)' '$*' show: - @$(bake_base_cli) $(TARGET) --print + @$(bake_base_cli) linux --print list: check-reqs @set -x; make --silent show | jq -r '.target | path(.. | select(.platforms[] | contains("linux/$(ARCH)"))?) | add' diff --git a/almalinux/almalinux8/hotspot/Dockerfile b/almalinux/almalinux8/hotspot/Dockerfile deleted file mode 100644 index 0f4bea8b77..0000000000 --- a/almalinux/almalinux8/hotspot/Dockerfile +++ /dev/null @@ -1,144 +0,0 @@ -FROM almalinux:8.10 as jre-build - -ARG JAVA_VERSION=11.0.24_8 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -COPY jdk-download-url.sh /usr/bin/jdk-download-url.sh -COPY jdk-download.sh /usr/bin/jdk-download.sh - -RUN dnf --setopt=install_weak_deps=0 --setopt=tsflags=nodocs install -y \ - ca-certificates \ - curl \ - jq \ - && dnf clean all \ - && /usr/bin/jdk-download.sh - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH -# Generate smaller java runtime without unneeded files -# for now we include the full module path to maintain compatibility -# while still saving space (approx 200mb from the full distribution) -# Arguments to jlink are specific to Java 11 jlink -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-debug \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime - -FROM almalinux:8.10 AS controller - -ENV LANG=C.UTF-8 - -ARG TARGETARCH -ARG COMMIT_SHA - -RUN dnf --setopt=install_weak_deps=0 --setopt=tsflags=nodocs install -y \ - fontconfig \ - freetype \ - git-lfs \ - unzip \ - tzdata \ - && \ - dnf clean all - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 -ARG http_port=8080 -ARG agent_port=50000 -ARG JENKINS_HOME=/var/jenkins_home -ARG REF=/usr/share/jenkins/ref - -ENV JENKINS_HOME=$JENKINS_HOME -ENV JENKINS_SLAVE_AGENT_PORT=${agent_port} -ENV REF=$REF - -# Jenkins is run with user `jenkins`, uid = 1000 -# If you bind mount a volume from the host or a data container, -# ensure you use the same uid -RUN mkdir -p $JENKINS_HOME \ - && chown ${uid}:${gid} $JENKINS_HOME \ - && groupadd -g ${gid} ${group} \ - && useradd -N -d "$JENKINS_HOME" -u ${uid} -g ${gid} -l -m -s /bin/bash ${user} - -# Jenkins home directory is a volume, so configuration and build history -# can be persisted and survive image upgrades -VOLUME $JENKINS_HOME - -# $REF (defaults to `/usr/share/jenkins/ref/`) contains all reference configuration we want -# to set on a fresh new installation. Use it to bundle additional plugins -# or config file with your custom jenkins Docker image. -RUN mkdir -p ${REF}/init.groovy.d - -# Use tini as subreaper in Docker container to adopt zombie processes -ARG TINI_VERSION=v0.19.0 -COPY tini_pub.gpg "${JENKINS_HOME}/tini_pub.gpg" -RUN curl -fsSL "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-${TARGETARCH}" -o /sbin/tini \ - && curl -fsSL "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-${TARGETARCH}.asc" -o /sbin/tini.asc \ - && gpg --no-tty --import "${JENKINS_HOME}/tini_pub.gpg" \ - && gpg --verify /sbin/tini.asc \ - && rm -rf /sbin/tini.asc /root/.gnupg \ - && chmod +x /sbin/tini - -# jenkins version being bundled in this docker image -ARG JENKINS_VERSION -ENV JENKINS_VERSION=${JENKINS_VERSION:-2.442} - -# jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c - -# Can be used to customize where jenkins.war get downloaded from -ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war - -# could use ADD but this one does not check Last-Modified header neither does it allow to control checksum -# see https://github.com/docker/docker/issues/8331 -RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ - && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -ENV JENKINS_UC=https://updates.jenkins.io -ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental -ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals -RUN chown -R ${user} "$JENKINS_HOME" "$REF" - -ARG PLUGIN_CLI_VERSION=2.13.0 -ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_CLI_VERSION}/jenkins-plugin-manager-${PLUGIN_CLI_VERSION}.jar -RUN curl -fsSL ${PLUGIN_CLI_URL} -o /opt/jenkins-plugin-manager.jar \ - && echo "$(curl -fsSL "${PLUGIN_CLI_URL}.sha256") /opt/jenkins-plugin-manager.jar" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -# for main web interface: -EXPOSE ${http_port} - -# will be used by attached agents: -EXPOSE ${agent_port} - -ENV COPY_REFERENCE_FILE_LOG=$JENKINS_HOME/copy_reference_file.log - -ENV JAVA_HOME=/opt/java/openjdk -ENV PATH="${JAVA_HOME}/bin:${PATH}" -COPY --from=jre-build /javaruntime $JAVA_HOME - -USER ${user} - -COPY jenkins-support /usr/local/bin/jenkins-support -COPY jenkins.sh /usr/local/bin/jenkins.sh -COPY jenkins-plugin-cli.sh /bin/jenkins-plugin-cli - -ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/jenkins.sh"] - -# metadata labels -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Docker image" \ - org.opencontainers.image.description="The Jenkins Continuous Integration and Delivery server" \ - org.opencontainers.image.version="${JENKINS_VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker" \ - org.opencontainers.image.revision="${COMMIT_SHA}" \ - org.opencontainers.image.licenses="MIT" diff --git a/alpine/hotspot/Dockerfile b/alpine/hotspot/Dockerfile index d183cb3b3d..8c757413f6 100644 --- a/alpine/hotspot/Dockerfile +++ b/alpine/hotspot/Dockerfile @@ -22,16 +22,14 @@ ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}" # for now we include the full module path to maintain compatibility # while still saving space (approx 200mb from the full distribution) RUN case "$(jlink --version 2>&1)" in \ - # jlink version 11 has less features than JDK17+ - "11."*) set -- "--strip-debug" "--compress=2" ;; \ - "17."*) set -- "--strip-java-debug-attributes" "--compress=2" ;; \ + "17."*) set -- "--compress=2" ;; \ # the compression argument is different for JDK21 - "21."*) set -- "--strip-java-debug-attributes" "--compress=zip-6" ;; \ + "21."*) set -- "--compress=zip-6" ;; \ *) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \ esac; \ jlink \ + --strip-java-debug-attributes \ "$1" \ - "$2" \ --add-modules ALL-MODULE-PATH \ --no-man-pages \ --no-header-files \ @@ -92,10 +90,10 @@ RUN mkdir -p ${REF}/init.groovy.d # jenkins version being bundled in this docker image ARG JENKINS_VERSION -ENV JENKINS_VERSION=${JENKINS_VERSION:-2.442} +ENV JENKINS_VERSION=${JENKINS_VERSION:-2.479} # jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c +ARG JENKINS_SHA=910ea36cef37c45087e39d65e335988e036fccea47c79cc5a52e721a10cb1b49 # Can be used to customize where jenkins.war get downloaded from ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war diff --git a/build-windows-lts-with-jdk11.yaml b/build-windows-lts-with-jdk11.yaml deleted file mode 100644 index 91a2bc0cfb..0000000000 --- a/build-windows-lts-with-jdk11.yaml +++ /dev/null @@ -1,50 +0,0 @@ -services: - jdk11: - image: ${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}${SEPARATOR_LTS_PREFIX}jdk11-hotspot-${WINDOWS_FLAVOR}-${WINDOWS_VERSION} - build: - context: ./ - dockerfile: ./windows/${WINDOWS_FLAVOR}/hotspot/Dockerfile - args: - COMMIT_SHA: ${COMMIT_SHA} - JAVA_HOME: "C:/openjdk-11" - JAVA_VERSION: 11.0.24_8 - JENKINS_SHA: ${JENKINS_SHA} - JENKINS_VERSION: ${JENKINS_VERSION} - TOOLS_WINDOWS_VERSION: ${TOOLS_WINDOWS_VERSION} - WINDOWS_VERSION: ${WINDOWS_VERSION} - tags: - - ${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}:${JENKINS_VERSION}-jdk11-hotspot-${WINDOWS_FLAVOR}-${WINDOWS_VERSION} - jdk17: - image: ${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}${SEPARATOR_LTS_PREFIX}jdk17-hotspot-${WINDOWS_FLAVOR}-${WINDOWS_VERSION} - build: - context: ./ - dockerfile: ./windows/${WINDOWS_FLAVOR}/hotspot/Dockerfile - args: - COMMIT_SHA: ${COMMIT_SHA} - JAVA_HOME: "C:/openjdk-17" - JAVA_VERSION: 17.0.12_7 - JENKINS_SHA: ${JENKINS_SHA} - JENKINS_VERSION: ${JENKINS_VERSION} - TOOLS_WINDOWS_VERSION: ${TOOLS_WINDOWS_VERSION} - WINDOWS_VERSION: ${WINDOWS_VERSION} - tags: - - ${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}:${JENKINS_VERSION}-jdk17-hotspot-${WINDOWS_FLAVOR}-${WINDOWS_VERSION} - - ${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}:${JENKINS_VERSION}-${WINDOWS_FLAVOR}-${WINDOWS_VERSION} - - ${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}${SEPARATOR_LTS_PREFIX}${WINDOWS_FLAVOR}-${WINDOWS_VERSION} - jdk21: - image: ${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}${SEPARATOR_LTS_PREFIX}jdk21-hotspot-${WINDOWS_FLAVOR}-${WINDOWS_VERSION} - build: - context: ./ - dockerfile: ./windows/${WINDOWS_FLAVOR}/hotspot/Dockerfile - args: - COMMIT_SHA: ${COMMIT_SHA} - JAVA_HOME: "C:/openjdk-21" - JAVA_VERSION: 21.0.4_7 - JENKINS_SHA: ${JENKINS_SHA} - JENKINS_VERSION: ${JENKINS_VERSION} - TOOLS_WINDOWS_VERSION: ${TOOLS_WINDOWS_VERSION} - WINDOWS_VERSION: ${WINDOWS_VERSION} - tags: - - ${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}:${JENKINS_VERSION}-jdk21-hotspot-${WINDOWS_FLAVOR}-${WINDOWS_VERSION} - - ${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}:${JENKINS_VERSION}-${WINDOWS_FLAVOR}-${WINDOWS_VERSION} - - ${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}${SEPARATOR_LTS_PREFIX}${WINDOWS_FLAVOR}-${WINDOWS_VERSION} diff --git a/debian/bookworm-slim/hotspot/Dockerfile b/debian/bookworm-slim/hotspot/Dockerfile index 4cdf529421..89f328b4c7 100644 --- a/debian/bookworm-slim/hotspot/Dockerfile +++ b/debian/bookworm-slim/hotspot/Dockerfile @@ -23,16 +23,14 @@ ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}" # for now we include the full module path to maintain compatibility # while still saving space (approx 200mb from the full distribution) RUN case "$(jlink --version 2>&1)" in \ - # jlink version 11 has less features than JDK17+ - "11."*) set -- "--strip-debug" "--compress=2" ;; \ - "17."*) set -- "--strip-java-debug-attributes" "--compress=2" ;; \ + "17."*) set -- "--compress=2" ;; \ # the compression argument is different for JDK21 - "21."*) set -- "--strip-java-debug-attributes" "--compress=zip-6" ;; \ + "21."*) set -- "--compress=zip-6" ;; \ *) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \ esac; \ jlink \ + --strip-java-debug-attributes \ "$1" \ - "$2" \ --add-modules ALL-MODULE-PATH \ --no-man-pages \ --no-header-files \ @@ -101,10 +99,10 @@ RUN mkdir -p ${REF}/init.groovy.d # jenkins version being bundled in this docker image ARG JENKINS_VERSION -ENV JENKINS_VERSION=${JENKINS_VERSION:-2.442} +ENV JENKINS_VERSION=${JENKINS_VERSION:-2.479} # jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c +ARG JENKINS_SHA=910ea36cef37c45087e39d65e335988e036fccea47c79cc5a52e721a10cb1b49 # Can be used to customize where jenkins.war get downloaded from ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war diff --git a/debian/bookworm/hotspot/Dockerfile b/debian/bookworm/hotspot/Dockerfile index 2c9e6beac5..06737ae58a 100644 --- a/debian/bookworm/hotspot/Dockerfile +++ b/debian/bookworm/hotspot/Dockerfile @@ -23,16 +23,14 @@ ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}" # for now we include the full module path to maintain compatibility # while still saving space (approx 200mb from the full distribution) RUN case "$(jlink --version 2>&1)" in \ - # jlink version 11 has less features than JDK17+ - "11."*) set -- "--strip-debug" "--compress=2" ;; \ - "17."*) set -- "--strip-java-debug-attributes" "--compress=2" ;; \ + "17."*) set -- "--compress=2" ;; \ # the compression argument is different for JDK21 - "21."*) set -- "--strip-java-debug-attributes" "--compress=zip-6" ;; \ + "21."*) set -- "--compress=zip-6" ;; \ *) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \ esac; \ jlink \ + --strip-java-debug-attributes \ "$1" \ - "$2" \ --add-modules ALL-MODULE-PATH \ --no-man-pages \ --no-header-files \ @@ -101,10 +99,10 @@ RUN mkdir -p ${REF}/init.groovy.d # jenkins version being bundled in this docker image ARG JENKINS_VERSION -ENV JENKINS_VERSION=${JENKINS_VERSION:-2.442} +ENV JENKINS_VERSION=${JENKINS_VERSION:-2.479} # jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c +ARG JENKINS_SHA=910ea36cef37c45087e39d65e335988e036fccea47c79cc5a52e721a10cb1b49 # Can be used to customize where jenkins.war get downloaded from ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war diff --git a/docker-bake.hcl b/docker-bake.hcl index 98af3a0207..90c7a1dc26 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -13,35 +13,12 @@ group "linux" { ] } -# TODO: remove when Java 11 is removed from LTS line -# See https://github.com/jenkinsci/docker/issues/1890 -group "linux-lts-with-jdk11" { - targets = [ - "almalinux_jdk11", - "alpine_jdk11", - "alpine_jdk17", - "alpine_jdk21", - "debian_jdk11", - "debian_jdk17", - "debian_jdk21", - "debian_slim_jdk11", - "debian_slim_jdk17", - "debian_slim_jdk21", - "rhel_ubi8_jdk11", - "rhel_ubi9_jdk17", - "rhel_ubi9_jdk21", - ] -} - group "linux-arm64" { targets = [ - "almalinux_jdk11", "alpine_jdk21", - "debian_jdk11", "debian_jdk17", "debian_jdk21", "debian_slim_jdk21", - "rhel_ubi8_jdk11", "rhel_ubi9_jdk17", "rhel_ubi9_jdk21", ] @@ -49,7 +26,6 @@ group "linux-arm64" { group "linux-s390x" { targets = [ - "debian_jdk11", "debian_jdk17", "debian_jdk21", ] @@ -57,7 +33,6 @@ group "linux-s390x" { group "linux-ppc64le" { targets = [ - "debian_jdk11", "debian_jdk17", "debian_jdk21", "rhel_ubi9_jdk17", @@ -68,11 +43,11 @@ group "linux-ppc64le" { # ---- variables ---- variable "JENKINS_VERSION" { - default = "2.442" + default = "2.479" } variable "JENKINS_SHA" { - default = "b0bc35b59ca923629cc440d79bebfa78d67cd0448c7a485168fc2719ac445e7b" + default = "910ea36cef37c45087e39d65e335988e036fccea47c79cc5a52e721a10cb1b49" } variable "REGISTRY" { @@ -107,10 +82,6 @@ variable "ALPINE_SHORT_TAG" { default = regex_replace(ALPINE_FULL_TAG, "\\.\\d+$", "") } -variable "JAVA11_VERSION" { - default = "11.0.24_8" -} - variable "JAVA17_VERSION" { default = "17.0.12_7" } @@ -151,44 +122,6 @@ function "tag_lts" { # ---- targets ---- -target "almalinux_jdk11" { - dockerfile = "almalinux/almalinux8/hotspot/Dockerfile" - context = "." - args = { - JENKINS_VERSION = JENKINS_VERSION - JENKINS_SHA = JENKINS_SHA - COMMIT_SHA = COMMIT_SHA - PLUGIN_CLI_VERSION = PLUGIN_CLI_VERSION - JAVA_VERSION = JAVA11_VERSION - } - tags = [ - tag(true, "almalinux"), - tag_weekly(false, "almalinux"), - tag_lts(false, "lts-almalinux") - ] - platforms = ["linux/amd64", "linux/arm64"] -} - -target "alpine_jdk11" { - dockerfile = "alpine/hotspot/Dockerfile" - context = "." - args = { - JENKINS_VERSION = JENKINS_VERSION - JENKINS_SHA = JENKINS_SHA - COMMIT_SHA = COMMIT_SHA - PLUGIN_CLI_VERSION = PLUGIN_CLI_VERSION - ALPINE_TAG = ALPINE_FULL_TAG - JAVA_VERSION = JAVA11_VERSION - } - tags = [ - tag(true, "alpine-jdk11"), - tag_weekly(false, "alpine-jdk11"), - tag_weekly(false, "alpine${ALPINE_SHORT_TAG}-jdk11"), - tag_lts(false, "lts-alpine-jdk11") - ] - platforms = ["linux/amd64"] -} - target "alpine_jdk17" { dockerfile = "alpine/hotspot/Dockerfile" context = "." @@ -233,27 +166,6 @@ target "alpine_jdk21" { platforms = ["linux/amd64", "linux/arm64"] } -target "debian_jdk11" { - dockerfile = "debian/bookworm/hotspot/Dockerfile" - context = "." - args = { - JENKINS_VERSION = JENKINS_VERSION - JENKINS_SHA = JENKINS_SHA - COMMIT_SHA = COMMIT_SHA - PLUGIN_CLI_VERSION = PLUGIN_CLI_VERSION - BOOKWORM_TAG = BOOKWORM_TAG - JAVA_VERSION = JAVA11_VERSION - } - tags = [ - tag(true, "jdk11"), - tag_weekly(false, "latest-jdk11"), - tag_weekly(false, "jdk11"), - tag_lts(false, "lts-jdk11"), - tag_lts(true, "lts-jdk11") - ] - platforms = ["linux/amd64", "linux/arm64", "linux/s390x", "linux/ppc64le"] -} - target "debian_jdk17" { dockerfile = "debian/bookworm/hotspot/Dockerfile" context = "." @@ -300,25 +212,6 @@ target "debian_jdk21" { platforms = ["linux/amd64", "linux/arm64", "linux/s390x", "linux/ppc64le"] } -target "debian_slim_jdk11" { - dockerfile = "debian/bookworm-slim/hotspot/Dockerfile" - context = "." - args = { - JENKINS_VERSION = JENKINS_VERSION - JENKINS_SHA = JENKINS_SHA - COMMIT_SHA = COMMIT_SHA - PLUGIN_CLI_VERSION = PLUGIN_CLI_VERSION - BOOKWORM_TAG = BOOKWORM_TAG - JAVA_VERSION = JAVA11_VERSION - } - tags = [ - tag(true, "slim-jdk11"), - tag_weekly(false, "slim-jdk11"), - tag_lts(false, "lts-slim-jdk11"), - ] - platforms = ["linux/amd64"] -} - target "debian_slim_jdk17" { dockerfile = "debian/bookworm-slim/hotspot/Dockerfile" context = "." @@ -361,25 +254,6 @@ target "debian_slim_jdk21" { platforms = ["linux/amd64", "linux/arm64"] } -target "rhel_ubi8_jdk11" { - dockerfile = "rhel/ubi8/hotspot/Dockerfile" - context = "." - args = { - JENKINS_VERSION = JENKINS_VERSION - JENKINS_SHA = JENKINS_SHA - COMMIT_SHA = COMMIT_SHA - PLUGIN_CLI_VERSION = PLUGIN_CLI_VERSION - JAVA_VERSION = JAVA11_VERSION - } - tags = [ - tag(true, "rhel-ubi8-jdk11"), - tag_weekly(false, "rhel-ubi8-jdk11"), - tag_lts(false, "lts-rhel-ubi8-jdk11"), - tag_lts(true, "lts-rhel-ubi8-jdk11") - ] - platforms = ["linux/amd64", "linux/arm64"] -} - target "rhel_ubi9_jdk17" { dockerfile = "rhel/ubi9/hotspot/Dockerfile" context = "." diff --git a/make.ps1 b/make.ps1 index a8dcb87480..2a75874739 100644 --- a/make.ps1 +++ b/make.ps1 @@ -2,7 +2,7 @@ Param( [Parameter(Position=1)] [String] $Target = 'build', - [String] $JenkinsVersion = '2.442', + [String] $JenkinsVersion = '2.479', [switch] $DryRun = $false ) @@ -57,14 +57,7 @@ $env:JENKINS_SHA = $webClient.DownloadString($jenkinsShaURL).ToUpper() $env:COMMIT_SHA=$(git rev-parse HEAD) -# Build all images including Java 11 if the version match a LTS versioning pattern -# TODO: remove when Java 11 is removed from LTS line -# See https://github.com/jenkinsci/docker/issues/1890 -$dockerComposeFile = 'build-windows.yaml' -if ($JenkinsVersion -match '^\d+\.\d+\.\d+$') { - $dockerComposeFile = 'build-windows-lts-with-jdk11.yaml' -} -$baseDockerCmd = 'docker-compose --file={0}' -f $dockerComposeFile +$baseDockerCmd = 'docker-compose --file=build-windows.yaml' $baseDockerBuildCmd = '{0} build --parallel --pull' -f $baseDockerCmd Write-Host "= PREPARE: List of $Organisation/$Repository images and tags to be processed:" diff --git a/rhel/ubi8/hotspot/Dockerfile b/rhel/ubi8/hotspot/Dockerfile deleted file mode 100644 index c7a3655c29..0000000000 --- a/rhel/ubi8/hotspot/Dockerfile +++ /dev/null @@ -1,147 +0,0 @@ -FROM registry.access.redhat.com/ubi8/ubi:8.10-1088 as jre-build - -ARG JAVA_VERSION=11.0.24_8 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -COPY jdk-download-url.sh /usr/bin/jdk-download-url.sh -COPY jdk-download.sh /usr/bin/jdk-download.sh - -RUN dnf install --disableplugin=subscription-manager --setopt=install_weak_deps=0 --setopt=tsflags=nodocs -y \ - ca-certificates \ - curl \ - jq \ - && dnf clean --disableplugin=subscription-manager all \ - && /usr/bin/jdk-download.sh - -ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH - -# Generate smaller java runtime without unneeded files -# for now we include the full module path to maintain compatibility -# while still saving space (approx 200mb from the full distribution) -# Arguments to jlink are specific to Java 11 jlink -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-debug \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime - -FROM registry.access.redhat.com/ubi8/ubi:8.10-1088 AS controller - -ENV LANG=C.UTF-8 - -ARG TARGETARCH -ARG COMMIT_SHA - -RUN dnf install --disableplugin=subscription-manager --setopt=install_weak_deps=0 --setopt=tsflags=nodocs -y \ - curl \ - fontconfig \ - freetype \ - git \ - git-lfs \ - unzip \ - which \ - tzdata \ - && dnf clean --disableplugin=subscription-manager all - -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 -ARG http_port=8080 -ARG agent_port=50000 -ARG JENKINS_HOME=/var/jenkins_home -ARG REF=/usr/share/jenkins/ref - -ENV JENKINS_HOME=$JENKINS_HOME -ENV JENKINS_SLAVE_AGENT_PORT=${agent_port} -ENV REF=$REF - -# Jenkins is run with user `jenkins`, uid = 1000 -# If you bind mount a volume from the host or a data container, -# ensure you use the same uid -RUN mkdir -p $JENKINS_HOME \ - && chown ${uid}:${gid} $JENKINS_HOME \ - && groupadd -g ${gid} ${group} \ - && useradd -N -d "$JENKINS_HOME" -u ${uid} -g ${gid} -l -m -s /bin/bash ${user} - -# Jenkins home directory is a volume, so configuration and build history -# can be persisted and survive image upgrades -VOLUME $JENKINS_HOME - -# $REF (defaults to `/usr/share/jenkins/ref/`) contains all reference configuration we want -# to set on a fresh new installation. Use it to bundle additional plugins -# or config file with your custom jenkins Docker image. -RUN mkdir -p ${REF}/init.groovy.d - -# Use tini as subreaper in Docker container to adopt zombie processes -ARG TINI_VERSION=v0.19.0 -COPY tini_pub.gpg "${JENKINS_HOME}/tini_pub.gpg" -RUN curl -fsSL "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-${TARGETARCH}" -o /sbin/tini \ - && curl -fsSL "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-${TARGETARCH}.asc" -o /sbin/tini.asc \ - && gpg --no-tty --import "${JENKINS_HOME}/tini_pub.gpg" \ - && gpg --verify /sbin/tini.asc \ - && rm -rf /sbin/tini.asc /root/.gnupg \ - && chmod +x /sbin/tini - -# jenkins version being bundled in this docker image -ARG JENKINS_VERSION -ENV JENKINS_VERSION=${JENKINS_VERSION:-2.442} - -# jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c - -# Can be used to customize where jenkins.war get downloaded from -ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war - -# could use ADD but this one does not check Last-Modified header neither does it allow to control checksum -# see https://github.com/docker/docker/issues/8331 -RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ - && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -ENV JENKINS_UC=https://updates.jenkins.io -ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental -ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals -RUN chown -R ${user} "$JENKINS_HOME" "$REF" - -ARG PLUGIN_CLI_VERSION=2.13.0 -ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGIN_CLI_VERSION}/jenkins-plugin-manager-${PLUGIN_CLI_VERSION}.jar -RUN curl -fsSL ${PLUGIN_CLI_URL} -o /opt/jenkins-plugin-manager.jar \ - && echo "$(curl -fsSL "${PLUGIN_CLI_URL}.sha256") /opt/jenkins-plugin-manager.jar" >/tmp/jenkins_sha \ - && sha256sum -c --strict /tmp/jenkins_sha \ - && rm -f /tmp/jenkins_sha - -# for main web interface: -EXPOSE ${http_port} - -# will be used by attached agents: -EXPOSE ${agent_port} - -ENV COPY_REFERENCE_FILE_LOG=$JENKINS_HOME/copy_reference_file.log - -ENV JAVA_HOME=/opt/java/openjdk -ENV PATH="${JAVA_HOME}/bin:${PATH}" -COPY --from=jre-build /javaruntime $JAVA_HOME - -USER ${user} - -COPY jenkins-support /usr/local/bin/jenkins-support -COPY jenkins.sh /usr/local/bin/jenkins.sh -COPY jenkins-plugin-cli.sh /bin/jenkins-plugin-cli - -ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/jenkins.sh"] - -# metadata labels -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Docker image" \ - org.opencontainers.image.description="The Jenkins Continuous Integration and Delivery server" \ - org.opencontainers.image.version="${JENKINS_VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker" \ - org.opencontainers.image.revision="${COMMIT_SHA}" \ - org.opencontainers.image.licenses="MIT" diff --git a/rhel/ubi9/hotspot/Dockerfile b/rhel/ubi9/hotspot/Dockerfile index 3001662ede..df0058d3e7 100644 --- a/rhel/ubi9/hotspot/Dockerfile +++ b/rhel/ubi9/hotspot/Dockerfile @@ -20,16 +20,14 @@ ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}" # for now we include the full module path to maintain compatibility # while still saving space (approx 200mb from the full distribution) RUN case "$(jlink --version 2>&1)" in \ - # jlink version 11 has less features than JDK17+ - "11."*) set -- "--strip-debug" "--compress=2" ;; \ - "17."*) set -- "--strip-java-debug-attributes" "--compress=2" ;; \ + "17."*) set -- "--compress=2" ;; \ # the compression argument is different for JDK21 - "21."*) set -- "--strip-java-debug-attributes" "--compress=zip-6" ;; \ + "21."*) set -- "--compress=zip-6" ;; \ *) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \ esac; \ jlink \ + --strip-java-debug-attributes \ "$1" \ - "$2" \ --add-modules ALL-MODULE-PATH \ --no-man-pages \ --no-header-files \ @@ -94,10 +92,10 @@ RUN curl -fsSL "https://github.com/krallin/tini/releases/download/${TINI_VERSION # jenkins version being bundled in this docker image ARG JENKINS_VERSION -ENV JENKINS_VERSION=${JENKINS_VERSION:-2.442} +ENV JENKINS_VERSION=${JENKINS_VERSION:-2.479} # jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c +ARG JENKINS_SHA=910ea36cef37c45087e39d65e335988e036fccea47c79cc5a52e721a10cb1b49 # Can be used to customize where jenkins.war get downloaded from ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war diff --git a/updatecli/scripts/check-jdk.sh b/updatecli/scripts/check-jdk.sh index 3338bc5d22..cb1b4dbcb7 100755 --- a/updatecli/scripts/check-jdk.sh +++ b/updatecli/scripts/check-jdk.sh @@ -13,14 +13,6 @@ function get_jdk_download_url() { jdk_version="${1}" platform="${2}" case "${jdk_version}" in - 8*) - ## JDK8 does not have the carret ('-') in their archive names - echo "https://github.com/adoptium/temurin8-binaries/releases/download/jdk${jdk_version}/OpenJDK8U-jdk_${platform}_hotspot_${jdk_version//-}"; - return 0;; - 11*) - ## JDK11 URLs have an underscore ('_') instead of a plus ('+') in their archive names - echo "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-${jdk_version}/OpenJDK11U-jdk_${platform}_hotspot_${jdk_version//+/_}"; - return 0;; 17*) ## JDK17 URLs have an underscore ('_') instead of a plus ('+') in their archive names echo "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-${jdk_version}/OpenJDK17U-jdk_${platform}_hotspot_${jdk_version//+/_}"; @@ -36,11 +28,6 @@ function get_jdk_download_url() { } case "${1}" in - 8u*) - # No s390x support for JDK8: $platforms is kept as default - platforms=("x64_linux" "x64_windows" "aarch64_linux");; - 11.*) - platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");; 17.*+*) platforms=("x64_linux" "x64_windows" "aarch64_linux" "s390x_linux");; 21*+*) diff --git a/updatecli/updatecli.d/jdk11.yaml b/updatecli/updatecli.d/jdk11.yaml deleted file mode 100644 index 6e278b49df..0000000000 --- a/updatecli/updatecli.d/jdk11.yaml +++ /dev/null @@ -1,99 +0,0 @@ ---- -name: Bump JDK11 version - -scms: - default: - kind: github - spec: - user: "{{ .github.user }}" - email: "{{ .github.email }}" - owner: "{{ .github.owner }}" - repository: "{{ .github.repository }}" - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - branch: "{{ .github.branch }}" - -sources: - lastVersion: - kind: githubrelease - name: Get the latest Adoptium JDK11 version - spec: - owner: "adoptium" - repository: "temurin11-binaries" - token: "{{ requiredEnv .github.token }}" - username: "{{ .github.username }}" - versionfilter: - kind: regex - pattern: "^jdk-11.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$" - transformers: - - trimprefix: "jdk-" - - replacer: - from: + - to: _ - -conditions: - checkTemurinAlpineRelease: - name: Check if the "" is available for alpine - kind: shell - spec: - command: sh ./jdk-download-url.sh '{{source "lastVersion" }}' alpine "x64" - disablesourceinput: true - checkTemurinLinuxRelease: - name: Check if the "" is available for Linux - kind: shell - spec: - command: sh ./jdk-download-url.sh '{{source "lastVersion" }}' standard "x64 aarch64 s390x" - disablesourceinput: true - checkTemurinWindowsRelease: - name: Check if the "" is available for Windows - kind: shell - spec: - command: sh ./jdk-download-url.sh '{{source "lastVersion" }}' windows "x64" - disablesourceinput: true - -targets: - ## Global config files - setJDK11VersionDockerBake: - name: "Bump JDK11 version for Linux images in the docker-bake.hcl file" - kind: hcl - spec: - file: docker-bake.hcl - path: variable.JAVA11_VERSION.default - scmid: default - setJDK11VersionWindowsDockerCompose: - name: "Bump JDK11 version in build-windows.yaml" - kind: yaml - spec: - file: build-windows-lts-with-jdk11.yaml - key: $.services.jdk11.build.args.JAVA_VERSION - scmid: default - ## Dockerfiles - # Setting default JAVA_VERSION ARG for remaining ad hoc JDK11 images - setJDK11VersionAlmaLinux8: - name: "Bump JDK11 version for Linux images in the Alma Linux 8 Dockerfile" - kind: dockerfile - spec: - file: almalinux/almalinux8/hotspot/Dockerfile - instruction: - keyword: ARG - matcher: JAVA_VERSION - scmid: default - setJDK11VersionRhel: - name: "Bump JDK11 version for Linux images in the Rhel Dockerfile" - kind: dockerfile - spec: - file: rhel/ubi8/hotspot/Dockerfile - instruction: - keyword: ARG - matcher: JAVA_VERSION - scmid: default - -actions: - default: - kind: github/pullrequest - scmid: default - title: Bump JDK11 version to {{ source "lastVersion" }} - spec: - labels: - - dependencies - - jdk11 diff --git a/updatecli/updatecli.d/jdk17.yaml b/updatecli/updatecli.d/jdk17.yaml index 439e902b4b..6a588b621b 100644 --- a/updatecli/updatecli.d/jdk17.yaml +++ b/updatecli/updatecli.d/jdk17.yaml @@ -68,7 +68,6 @@ targets: spec: files: - build-windows.yaml - - build-windows-lts-with-jdk11.yaml key: $.services.jdk17.build.args.JAVA_VERSION scmid: default ## Dockerfiles diff --git a/updatecli/updatecli.d/jdk21.yaml b/updatecli/updatecli.d/jdk21.yaml index 25f62ccff0..fbe8800df7 100644 --- a/updatecli/updatecli.d/jdk21.yaml +++ b/updatecli/updatecli.d/jdk21.yaml @@ -66,7 +66,6 @@ targets: spec: files: - build-windows.yaml - - build-windows-lts-with-jdk11.yaml key: $.services.jdk21.build.args.JAVA_VERSION scmid: default diff --git a/windows/windowsservercore/hotspot/Dockerfile b/windows/windowsservercore/hotspot/Dockerfile index 50ae8121e1..219a2aae5a 100644 --- a/windows/windowsservercore/hotspot/Dockerfile +++ b/windows/windowsservercore/hotspot/Dockerfile @@ -24,11 +24,8 @@ RUN Write-Host 'javac --version' ; javac --version ; ` Write-Host 'java --version' ; java --version RUN $version = (jlink --version) ; ` - $stripJavaDebugArg = '--strip-java-debug-attributes' ; ` $compressArg = '--compress=2' ; ` switch ($version.Substring(0,3)) { ` - # jlink version 11 has less features than JDK17+ - '11.' { $stripJavaDebugArg = '--strip-debug' } ` '17.' {} ` # the compression argument is different for JDK21 '21.' { $compressArg = '--compress=zip-6' } ` @@ -38,7 +35,7 @@ RUN $version = (jlink --version) ; ` } ` } ` & jlink ` - $stripJavaDebugArg ` + --strip-java-debug-attributes ` $compressArg ` --add-modules ALL-MODULE-PATH ` --no-man-pages ` @@ -97,10 +94,10 @@ RUN New-Item -ItemType Directory -Force -Path C:/ProgramData/Jenkins/Reference/i # jenkins version being bundled in this docker image ARG JENKINS_VERSION -ENV JENKINS_VERSION=${JENKINS_VERSION:-2.442} +ENV JENKINS_VERSION=${JENKINS_VERSION:-2.479} # jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=b4f596923eb37b93c3f5a21a6a32fc3bedd57d04a1b63186811c0ce8b3d9f07c +ARG JENKINS_SHA=910ea36cef37c45087e39d65e335988e036fccea47c79cc5a52e721a10cb1b49 # Can be used to customize where jenkins.war get downloaded from ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war