-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Java 25 target for all images #7
base: master
Are you sure you want to change the base?
Conversation
Fixes #6 Add Java 25 target for all images in docker bake and other necessary places. * Modify `docker-bake.hcl` to include Java 25 in various targets and functions. * Update `alpine/Dockerfile`, `debian/Dockerfile`, and `rhel/ubi9/Dockerfile` to handle Java 25 in the `jlink` command. * Modify `build.ps1` to include Java 25 in the `jdks_to_build` variable and update the `Test-Image` function. * Update `updatecli/updatecli.d/jdk21.yaml` to `updatecli/updatecli.d/jdk25.yaml` and modify relevant fields for Java 25. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/gounthar/docker-agent/issues/6?shareId=XXXX-XXXX-XXXX-XXXX).
Warning Rate limit exceeded@gounthar has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 21 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughThis pull request updates multiple Dockerfiles and the docker-bake configuration to incorporate support for JDK 25. The changes streamline the jlink command by introducing an Changes
Sequence Diagram(s)sequenceDiagram
participant Builder as Docker Build Process
participant VersionCheck as JDK Version Check
participant Jlink as jlink Command
Builder->>VersionCheck: Determine current JDK version
alt JDK 25 detected
VersionCheck-->>Builder: Set options (modules & --compress=zip-6)
Builder->>Jlink: Execute jlink with JDK 25 options
else JDK 17/21 detected
VersionCheck-->>Builder: Set options for existing JDK versions
Builder->>Jlink: Execute jlink with standard options
else Unsupported version
Builder->>Builder: Emit descriptive error message
end
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (2)
windows/windowsservercore/Dockerfile (2)
32-40
: 🛠️ Refactor suggestionRefactor duplicated Java installation block.
The Java installation block is duplicated for JDK 25. Consider refactoring to avoid duplication and potential maintenance issues.
-ARG JAVA_VERSION=17.0.10+7 -RUN New-Item -ItemType Directory -Path C:\temp | Out-Null ; ` - $javaMajorVersion = $env:JAVA_VERSION.substring(0,2) ; ` - $msiUrl = 'https://api.adoptium.net/v3/installer/version/jdk-{0}/windows/x64/jdk/hotspot/normal/eclipse?project=jdk' -f $env:JAVA_VERSION.Replace('+', '%2B') ; ` - Invoke-WebRequest $msiUrl -OutFile 'C:\temp\jdk.msi' ; ` - $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList '/i', 'C:\temp\jdk.msi', '/L*V', 'C:\temp\OpenJDK.log', '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', "INSTALLDIR=C:\openjdk-${javaMajorVersion}" -Wait -Passthru ; ` - $proc.WaitForExit() ; ` - Remove-Item -Path C:\temp -Recurse | Out-Null -ARG JAVA_VERSION=25.0.0+1 -RUN New-Item -ItemType Directory -Path C:\temp | Out-Null ; ` - $javaMajorVersion = $env:JAVA_VERSION.substring(0,2) ; ` - $msiUrl = 'https://api.adoptium.net/v3/installer/version/jdk-{0}/windows/x64/jdk/hotspot/normal/eclipse?project=jdk' -f $env:JAVA_VERSION.Replace('+', '%2B') ; ` - Invoke-WebRequest $msiUrl -OutFile 'C:\temp\jdk.msi' ; ` - $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList '/i', 'C:\temp\jdk.msi', '/L*V', 'C:\temp\OpenJDK.log', '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', "INSTALLDIR=C:\openjdk-${javaMajorVersion}" -Wait -Passthru ; ` - $proc.WaitForExit() ; ` - Remove-Item -Path C:\temp -Recurse | Out-Null +ARG JAVA_VERSION=25.0.0+1 +RUN New-Item -ItemType Directory -Path C:\temp | Out-Null ; ` + $javaMajorVersion = $env:JAVA_VERSION.substring(0,2) ; ` + $msiUrl = 'https://api.adoptium.net/v3/installer/version/jdk-{0}/windows/x64/jdk/hotspot/normal/eclipse?project=jdk' -f $env:JAVA_VERSION.Replace('+', '%2B') ; ` + Invoke-WebRequest $msiUrl -OutFile 'C:\temp\jdk.msi' ; ` + $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList '/i', 'C:\temp\jdk.msi', '/L*V', 'C:\temp\OpenJDK.log', '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', "INSTALLDIR=C:\openjdk-${javaMajorVersion}" -Wait -Passthru ; ` + $proc.WaitForExit() ; ` + Remove-Item -Path C:\temp -Recurse | Out-NullAlso applies to: 41-48
53-62
: 🛠️ Refactor suggestionRefactor duplicated JAVA_HOME configuration.
The JAVA_HOME configuration is duplicated. Consider refactoring to avoid duplication.
-ARG JAVA_HOME="C:\openjdk-17" -ENV JAVA_HOME=${JAVA_HOME} -COPY --from=jdk-core $JAVA_HOME $JAVA_HOME -ARG JAVA_HOME="C:\openjdk-25" -ENV JAVA_HOME=${JAVA_HOME} -COPY --from=jdk-core $JAVA_HOME $JAVA_HOME +ARG JAVA_HOME="C:\openjdk-25" +ENV JAVA_HOME=${JAVA_HOME} +COPY --from=jdk-core $JAVA_HOME $JAVA_HOME
🧹 Nitpick comments (2)
docker-bake.hcl (2)
175-182
: Consider future-proofing the alpine_platforms function.While the implementation is correct, consider refactoring to reduce duplication and make future JDK additions easier.
function "alpine_platforms" { params = [jdk] - result = (equal(21, jdk) - ? ["linux/amd64", "linux/arm64"] - : (equal(25, jdk) - ? ["linux/amd64", "linux/arm64"] - : ["linux/amd64"])) + result = (contains([21, 25], jdk) + ? ["linux/amd64", "linux/arm64"] + : ["linux/amd64"]) }
185-192
: Consider future-proofing the debian_platforms function.Similar to alpine_platforms, the function could be refactored to reduce duplication and improve maintainability.
function "debian_platforms" { params = [jdk] - result = (equal(17, jdk) - ? ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/arm/v7"] - : (equal(21, jdk) - ? ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x"] - : ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x"])) + result = equal(17, jdk) + ? ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/arm/v7"] + : ["linux/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x"] }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
alpine/Dockerfile
(1 hunks)build.ps1
(1 hunks)debian/Dockerfile
(1 hunks)docker-bake.hcl
(6 hunks)rhel/ubi9/Dockerfile
(1 hunks)updatecli/updatecli.d/jdk25.yaml
(3 hunks)windows/windowsservercore/Dockerfile
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- build.ps1
🧰 Additional context used
🪛 GitHub Actions: updatecli
updatecli/updatecli.d/jdk25.yaml
[error] 1-1: Pipeline 'Bump JDK25 version for all Linux images' failed: Got an HTTP error 404 from the API.
🔇 Additional comments (8)
updatecli/updatecli.d/jdk25.yaml (1)
2-2
: LGTM! Configuration updates are consistent.The configuration has been consistently updated to reference JDK 25 across all sections:
- Name and description
- Source configuration
- Conditions
- Targets
- Actions and labels
Also applies to: 26-31, 37-38, 52-54, 61-62, 68-72
rhel/ubi9/Dockerfile (1)
30-31
: LGTM! JDK 25 support added correctly.The changes correctly add support for JDK 25 using the same compression argument as JDK 21.
✅ Verification successful
🌐 Web query:
Is the compression argument "--compress=zip-6" supported in JDK 25's jlink command?
💡 Result:
Yes, the
--compress=zip-6
argument is supported in JDK 25'sjlink
command. This change was introduced as part of an alignment betweenjlink
andjmod
compression options[2][3][10].Key Details:
Deprecation of Old Values
- Legacy compression flags (
0
,1
,2
) were deprecated starting in JDK 21[2][10].- Using deprecated values now triggers warnings (e.g.,
--compress=2
maps tozip-6
but warns about deprecation)[2][10].New Compression Format
- Valid options are now
zip-[0-9]
, where:
zip-0
: No compression (equivalent to legacy--compress=0
)zip-9
: Maximum compression (best space savings)- Default:
zip-6
(balanced compression)[2][3].JDK 25 Support
- The
zip-[0-9]
syntax has been fully supported since JDK 21[10], and this support continues in JDK 25.- Example usage:
jlink --compress=zip-6 --output custom-jreWhy This Matters:
The new format aligns with standard UNIX-style ZIP compression levels and provides finer control over space/performance tradeoffs[2]. For example:
Compression Level Use Case zip-0
Fastest execution zip-6
Balanced zip-9
Smallest image For compatibility with future JDK releases, use the new
zip-N
format instead of numeric codes like2
[10].Citations:
- 1: https://docs.oracle.com/en/java/javase/14/docs/specs/man/jlink.html
- 2: https://bugs.openjdk.org/browse/JDK-8301124
- 3: https://bugs.openjdk.org/browse/JDK-8321139
- 4: https://docs.oracle.com/en/java/javase/11/tools/jlink.html
- 5: https://www.youtube.com/watch?v=3UCBmdbeYm4
- 6: https://docs.oracle.com/javase/9/tools/jlink.htm
- 7: https://dzone.com/articles/ways-to-reduce-jvm-docker-image-size
- 8: https://dev.to/cherrychain/javafx-jlink-and-jpackage-h9
- 9: https://www.infoworld.com/article/3578589/java-proposal-would-shrink-jdk-by-25.html
- 10: Documentation: jlink 21 deprecates some --compress values beryx/badass-runtime-plugin#149
JDK 25 Compression Argument Confirmed
The web query confirms that--compress=zip-6
is valid and supported in JDK 25'sjlink
command. This aligns perfectly with the intended change for JDK 25 support.alpine/Dockerfile (1)
48-49
: LGTM! JDK 25 support added consistently.The changes correctly add support for JDK 25, maintaining consistency with the implementation in other Dockerfiles.
debian/Dockerfile (1)
53-54
: LGTM! JDK 25 support added consistently.The changes correctly add support for JDK 25, maintaining consistency with the implementation in other Dockerfiles.
docker-bake.hcl (4)
20-20
: LGTM! Comprehensive JDK 25 target additions.The changes consistently add JDK 25 targets across all relevant agent groups (linux-agent-only, linux-inbound-agent-only, linux-arm64).
Also applies to: 23-23, 25-26, 34-34, 37-37, 39-40, 47-47
164-171
: LGTM! Clean extension of javaversion function.The function has been elegantly extended to support JDK 25 while maintaining the existing logic for JDK 17 and 21.
297-301
: Verify RHEL UBI 9 compatibility with JDK 25.The rhel_ubi9 target matrix has been updated to include JDK 25. However, the comment at line 226 suggests that only JDK 17 and 21 are supported for UBI 9.
✅ Verification successful
🏁 Script executed:
#!/bin/bash # Check if there are any compatibility notes or issues mentioned in the RHEL UBI 9 Dockerfile rg -A 5 "JDK.*25|Java.*25" rhel/ubi9/DockerfileLength of output: 282
RHEL UBI9 Dockerfile explicitly handles JDK25 with a specialized compression argument, confirming support for JDK 25.
- The Dockerfile checks for JDK version matching "25." and sets the compression flag (
--compress=zip-6
).- This confirms that the UBI9 build adapts to JDK 25, meaning the earlier comment limiting support appears outdated.
76-78
: Verify JDK 25 version compatibility.The changes introduce JDK 25 support with version "25.0.0_1". Since JDK 25 is still in early access, we should verify compatibility and stability.
Also applies to: 92-94
✅ Verification successful
🌐 Web query:
What is the current status and latest version of JDK 25?
💡 Result:
JDK 25 is currently in active development, targeting a general availability (GA) release in September 2025 as part of Oracle's biannual release cycle[1][3][4][6]. Here's the detailed status:
Development Status
- Current phase: Mainline open for bug fixes and small enhancements[1]
- Early-access builds: Available through OpenJDK under GNU GPLv2 license[5]
- Bytecode version: Will use bytecode format 69.0[3]
Version Timeline
Milestone Date Details Planned GA Sep 2025 First stable release[3][4] First update Oct 2025 Version 25.0.1 planned[4] Extended Support Until Sep 2030 For LTS versions[3][6] Key Context
- Will be Oracle's next Long-Term Support (LTS) release after Java 21[6][9]
- Follows the new 2-year LTS cadence (previous LTS versions: Java 17 and Java 21)[6][9]
- Security updates will continue until at least 2030 for commercial users[6]
The latest available build as of February 2025 remains an early-access version from OpenJDK[5], with no production-ready release yet available. Developers can track progress through the OpenJDK project page and early-access builds while awaiting the September GA date[1][5].
Citations:
- 1: https://openjdk.org/projects/jdk/25/
- 2: https://www.oracle.com/java/technologies/javase/8u25-relnotes.html
- 3: https://javaalmanac.io/jdk/
- 4: https://www.java.com/releases/matrix/
- 5: https://jdk.java.net/25/
- 6: https://endoflife.date/oracle-jdk
- 7: https://jdk.java.net/25/release-notes
- 8: https://www.oracle.com/java/technologies/javase/11-0-25-relnotes.html
- 9: https://www.oracle.com/java/technologies/java-se-support-roadmap.html
- 10: https://www.java.com/releases/
JDK 25 Early Access Status Verified
Based on the latest available information, JDK 25 is still in active development with early-access builds available—its general availability is scheduled for September 2025. Although the early-access build (version "25.0.0_1") can be used for experimental or testing purposes, it may not yet be fully stable for production scenarios. Ensure that compatibility and stability are thoroughly tested before integrating it into a production pipeline.
- File: docker-bake.hcl (Lines 76-78 and 92-94)
updatecli/updatecli.d/jdk25.yaml
Outdated
temurin25-binaries: | ||
kind: "github" | ||
spec: | ||
user: "{{ .github.user }}" | ||
email: "{{ .github.email }}" | ||
owner: "adoptium" | ||
repository: "temurin21-binaries" | ||
repository: "temurin25-binaries" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify the existence of the Temurin 25 binaries repository.
The pipeline failure indicates that the repository temurin25-binaries
might not exist yet. Please verify the availability of JDK 25 binaries.
🌐 Web query:
Does Eclipse Temurin provide JDK 25 binaries? What is the latest version of JDK available from Eclipse Temurin?
💡 Result:
Eclipse Temurin does not currently provide JDK 25 binaries[1][2]. As of February 2025, the latest available versions are:
Current Releases
- JDK 23 (non-LTS): Version
23.0.2+7
released January 23, 2025[2][9] - JDK 21 (LTS): Version
21.0.6+7
released January 22, 2025[2][5]
Long-Term Support (LTS) Status
- JDK 21 LTS: Supported until December 31, 2029[2][8]
- JDK 17 LTS: Supported until October 31, 2027[2]
- JDK 11 LTS: Extended support until October 31, 2027[4][6]
Temurin follows OpenJDK's release cadence of new feature versions every six months[2][8], with LTS releases every two years[2]. The latest quarterly security updates in November 2024 included versions up to JDK 23[9]. For production environments, JDK 21 LTS remains the recommended choice due to its extended support window[1][8].
Citations:
- 1: https://adoptium.net/temurin/releases/
- 2: https://endoflife.date/eclipse-temurin
- 3: https://adtmag.com/Blogs/WatersWorks/2024/06/New-Release-of-Eclipse-Temurin.aspx
- 4: https://docs.redhat.com/it/documentation/red_hat_build_of_openjdk/11/html-single/release_notes_for_eclipse_temurin_11.0.25/index
- 5: https://github.com/adoptium/temurin21-binaries/releases
- 6: https://docs.redhat.com/en/documentation/red_hat_build_of_openjdk/11/html-single/release_notes_for_eclipse_temurin_11.0.26/release_notes_for_eclipse_temurin_11.0.26
- 7: https://github.com/adoptium/temurin11-binaries/releases
- 8: https://adoptium.net/temurin/
- 9: https://adoptium.net/blog/2024/11/eclipse-temurin-8u432-11025-1713-2105-2301-available/
- 10: https://adoptium.net
Temurin 25 binaries do not exist.
The web query confirms that Eclipse Temurin does not provide JDK 25 binaries. The latest available versions are JDK 23 (non-LTS) and JDK 21 (LTS). Hence, the configuration in updatecli/updatecli.d/jdk25.yaml
referencing the non-existent temurin25-binaries
repository needs to be updated.
- Update the configuration to refer to a supported JDK version (e.g., JDK 23 or JDK 21).
windows/windowsservercore/Dockerfile
Outdated
@@ -38,6 +38,15 @@ RUN New-Item -ItemType Directory -Path C:\temp | Out-Null ; ` | |||
$proc.WaitForExit() ; ` | |||
Remove-Item -Path C:\temp -Recurse | Out-Null | |||
|
|||
ARG JAVA_VERSION=25.0.0+1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify JDK 25 version availability.
Please verify that the specified JDK 25 version is available from Adoptium.
🌐 Web query:
Is JDK version 25.0.0+1 available from Eclipse Temurin?
💡 Result:
Eclipse Temurin does not currently offer JDK version 25.0.0+1 based on the available information[1][3][4][5][7][8]. The latest supported versions as of February 2025 include:
- 8u442 (LTS)
- 11.0.26 (LTS)
- 17.0.14 (LTS)
- 21.0.6 (LTS)
- 23.0.2
Temurin follows OpenJDK's release cadence where new feature releases arrive every six months[5]. Version numbers above 23.x haven't been mentioned in any official release notes or documentation[1][3][9][10], and the project's support matrix only lists versions up to JDK 23[4][5]. For production environments, users are advised to use one of the LTS versions (8, 11, 17, or 21)[4][7].
Citations:
- 1: https://adoptium.net/es/blog/2025/02/eclipse-temurin-8u442-11026-17014-2106-2302-available/
- 2: https://docs.redhat.com/it/documentation/red_hat_build_of_openjdk/11/html-single/release_notes_for_eclipse_temurin_11.0.25/index
- 3: https://adoptium.net/blog/2024/11/eclipse-temurin-8u432-11025-1713-2105-2301-available/
- 4: https://openliberty.io/docs/latest/java-se.html
- 5: https://endoflife.date/eclipse-temurin
- 6: https://hub.docker.com/layers/library/eclipse-temurin/17.0.7_7-jdk-alpine/images/sha256-b617ad10f590d8933bc3971651dab334bde4c9e842e2a03cf113ae09ec1aeff3
- 7: https://adoptium.net/temurin/releases/
- 8: https://adoptium.net/temurin/releases/?version=8
- 9: https://docs.redhat.com/en/documentation/red_hat_build_of_openjdk/17/html-single/release_notes_for_eclipse_temurin_17.0.14/index
- 10: https://docs.redhat.com/en/documentation/red_hat_build_of_openjdk/11/html-single/release_notes_for_eclipse_temurin_11.0.18/index
JDK 25.0.0+1 is not available from Eclipse Temurin.
- The web query confirms that Temurin does not offer JDK version 25.0.0+1, with support only up to version 23.x as of February 2025.
- The Dockerfile in
windows/windowsservercore/Dockerfile
(line 41) should be updated to reference a supported JDK version (e.g., one of the LTS versions or a supported feature release).
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
Thanks, Hervé! 👍 Co-authored-by: lemeurherveCB <137290663+lemeurherveCB@users.noreply.github.com>
Co-authored-by: lemeurherveCB <137290663+lemeurherveCB@users.noreply.github.com>
The `-preview` is replicated in the URL (https://api.adoptium.net/v3/binary/version/jdk-25%2B9-ea-beta-preview/alpine-linux/x64/jdk/hotspot/normal/eclipse?project=jdk.), leading to a 404. We have to find a workaround.
Fixes #6
Add Java 25 target for all images in docker bake and other necessary places.
docker-bake.hcl
to include Java 25 in various targets and functions.alpine/Dockerfile
,debian/Dockerfile
, andrhel/ubi9/Dockerfile
to handle Java 25 in thejlink
command.build.ps1
to include Java 25 in thejdks_to_build
variable and update theTest-Image
function.updatecli/updatecli.d/jdk21.yaml
toupdatecli/updatecli.d/jdk25.yaml
and modify relevant fields for Java 25.For more details, open the Copilot Workspace session.
Summary by CodeRabbit
New Features
Refactor