Skip to content
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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Add Java 25 target for all images #7

wants to merge 15 commits into from

Conversation

gounthar
Copy link
Owner

@gounthar gounthar commented Feb 12, 2025

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.

Summary by CodeRabbit

  • New Features

    • Introduced support for Java 25 across build pipelines, expanding compatibility alongside existing Java versions.
    • Updated deployment targets to include Java 25, ensuring broader runtime support.
  • Refactor

    • Streamlined command configurations for runtime image generation with consolidated options.
    • Enhanced error messaging for unsupported Java versions and improved formatting for better consistency.

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).
Copy link

coderabbitai bot commented Feb 12, 2025

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between b6c9019 and 11aaa53.

📒 Files selected for processing (2)
  • docker-bake.hcl (7 hunks)
  • rhel/ubi9/Dockerfile (2 hunks)

Walkthrough

This 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 options variable that consolidates command-line arguments, adding a new branch for JDK 25 with specific modules and the --compress=zip-6 flag. Error messages have been enhanced for unsupported Java versions. Additionally, the docker-bake configuration now includes JDK 25 in its build targets by updating variables and functions to recognize the new version.

Changes

File(s) Change Summary
alpine/Dockerfile, debian/Dockerfile, rhel/ubi9/Dockerfile Modified jlink command logic to support JDK 25 by introducing an options variable, specifying modules (java.base, java.logging, java.xml, java.se) with --compress=zip-6, and improving error handling messages.
docker-bake.hcl Enhanced configuration to support JDK 25 by updating jdks_to_build to include 25, adding the JAVA25_VERSION variable, and modifying functions/target matrices to include new JDK 25 build targets across multiple groups.

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
Loading

Poem

I'm a rabbit in the code, hopping light and free,
With JDK 25 in sight, my Docker builds dance with glee.
Options neatly bundled, like carrots in a row,
Error messages chirp once the unsupported winds blow.
Here's to new features—a bright bug-free spree!
🐰✨ Hip hop, code on, in our joyful decree!


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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 suggestion

Refactor 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-Null

Also applies to: 41-48


53-62: 🛠️ Refactor suggestion

Refactor 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

📥 Commits

Reviewing files that changed from the base of the PR and between 89d4309 and f42bc81.

📒 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's jlink command. This change was introduced as part of an alignment between jlink and jmod compression options[2][3][10].

Key Details:

  1. 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 to zip-6 but warns about deprecation)[2][10].
  2. 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].
  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-jre

Why 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 like 2[10].

Citations:


JDK 25 Compression Argument Confirmed
The web query confirms that --compress=zip-6 is valid and supported in JDK 25's jlink 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/Dockerfile

Length 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:


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)

Comment on lines 15 to 21
temurin25-binaries:
kind: "github"
spec:
user: "{{ .github.user }}"
email: "{{ .github.email }}"
owner: "adoptium"
repository: "temurin21-binaries"
repository: "temurin25-binaries"
Copy link

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:


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).

@@ -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
Copy link

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:


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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a Java 25 target for all images
1 participant