Skip to content

Re-enable dependency based JRE #2434

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

afranken
Copy link
Member

@afranken afranken commented Jun 4, 2025

Description

Looks like this was finally fixed in a JRE 21 patch version

Related Issue

N/A

Tasks

  • I have signed the CLA.
  • I have written tests and verified that they fail without my change.

Looks like this was finally fixed in a JRE 21 patch version
@afranken afranken requested a review from Copilot June 5, 2025 11:26
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR restores dynamic JRE creation by unpacking the Spring Boot fat JAR, discovering required modules with jdeps (targeting Java 21), and building a minimal runtime with jlink.

  • Unpacked s3mock-exec.jar for dependency analysis
  • Reactivated jdeps with --multi-release 21 and output to jre-deps.info
  • Invoked jlink using discovered modules plus jdk.crypto.ec
Comments suppressed due to low confidence (1)

docker/Dockerfile:47

  • jlink requires a --module-path pointing to the JDK modules (e.g., --module-path "$JAVA_HOME/jmods") so it can locate platform modules when assembling the minimal JRE.
RUN jlink \

--print-module-deps \
--recursive \
# specify the the dependencies for the jar
--class-path ${TMP_DIR}/BOOT-INF/lib/* ${TMP_DIR}/BOOT-INF/classes ${TMP_DIR} \
Copy link
Preview

Copilot AI Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --class-path flag expects a single classpath string; combine multiple paths with ':' (e.g., --class-path ${TMP_DIR}/BOOT-INF/lib/*:${TMP_DIR}/BOOT-INF/classes:${TMP_DIR}) rather than passing separate arguments.

Suggested change
--class-path ${TMP_DIR}/BOOT-INF/lib/* ${TMP_DIR}/BOOT-INF/classes ${TMP_DIR} \
--class-path ${TMP_DIR}/BOOT-INF/lib/*:${TMP_DIR}/BOOT-INF/classes:${TMP_DIR} \

Copilot uses AI. Check for mistakes.

# --output "$JAVA_MINIMAL"
# find JDK dependencies dynamically from unpacked jar
RUN jdeps \
# dont worry about missing modules
Copy link
Preview

Copilot AI Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using the correct contraction don't instead of dont for clarity in comments.

Suggested change
# dont worry about missing modules
# don't worry about missing modules

Copilot uses AI. Check for mistakes.

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.

1 participant