-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
35 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
FROM debian:latest | ||
FROM ubuntu:focal | ||
|
||
ENV JDK_URL=https://download.java.net/java/early_access/leyden/2/openjdk-24-leyden+2-8_linux-x64_bin.tar.gz | ||
ENV JAVA_HOME=/opt/java/openjdk | ||
ENV PATH="$JAVA_HOME/bin:$PATH" | ||
COPY ./leyden/setup.sh /setup.sh | ||
RUN ./setup.sh | ||
|
||
RUN apt-get update && apt-get install -y wget tar && rm -rf /var/lib/apt/lists/* | ||
FROM ubuntu:focal | ||
RUN mkdir -p /opt/leyden/test/hotspot/jtreg/premain | ||
COPY --from=0 /opt/jdk /opt/jdk | ||
|
||
RUN mkdir -p "$JAVA_HOME" && wget -qO- "$JDK_URL" | tar -xz --strip-components=1 -C "$JAVA_HOME" | ||
ENV JAVA_HOME /opt/jdk | ||
ENV PATH $JAVA_HOME/bin:$PATH | ||
|
||
RUN mkdir -p build | ||
COPY build.gradle gradlew settings.gradle build/ | ||
COPY gradle build/gradle | ||
COPY ./src build/src | ||
RUN (cd build && gradlew assemble) | ||
RUN (cd build && ./gradlew assemble) | ||
|
||
COPY ./leyden/unpack-executable-jar.sh ./unpack-executable-jar.sh | ||
RUN ./unpack-executable-jar.sh -d build-unpacked build/build/libs/hello-world-0.0.1-SNAPSHOT.jar | ||
RUN rm -rf build unpack-executable-jar.sh | ||
RUN java -Dspring.aot.enabled=true -Dspring.context.exit=onRefresh -XX:CacheDataStore=build-unpacked/application.cds -jar build-unpacked/run-app.jar | ||
|
||
CMD ["java", "-Dspring.aot.enabled=true", "-XX:CacheDataStore=build-unpacked/application.cds", "-jar", "build-unpacked/run-app.jar"] | ||
CMD ["java", "-Dspring.aot.enabled=true", "-XX:CacheDataStore=build-unpacked/application.cds", "-jar", "build-unpacked/run-app.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
apt-get update | ||
apt-get install -y --no-install-recommends tzdata ca-certificates git curl build-essential libfreetype6-dev libfontconfig-dev libcups2-dev libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev libasound2-dev libffi-dev autoconf file unzip zip nano | ||
|
||
export ARCH=$(uname -m) | ||
case $ARCH in | ||
aarch64) export BOOT_JDK_URL="https://download.bell-sw.com/java/21+37/bellsoft-jdk21+37-linux-aarch64.tar.gz" ;; | ||
*) export BOOT_JDK_URL="https://download.bell-sw.com/java/21+37/bellsoft-jdk21+37-linux-amd64.tar.gz" ;; | ||
esac | ||
mkdir -p /opt/boot-jdk | ||
cd /opt/boot-jdk | ||
curl -L ${BOOT_JDK_URL} | tar zx --strip-components=1 | ||
test -f /opt/boot-jdk/bin/java | ||
test -f /opt/boot-jdk/bin/javac | ||
|
||
cd /opt | ||
git clone -b premain --depth 1 https://github.com/openjdk/leyden.git | ||
cd leyden | ||
|
||
bash configure --with-boot-jdk=/opt/boot-jdk | ||
make images | ||
mv /opt/leyden/build/linux-$ARCH-server-release/images/jdk /opt |