Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
timosalm committed Nov 8, 2024
1 parent b0df00a commit 81d770e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
18 changes: 10 additions & 8 deletions leyden/Dockerfile
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"]
25 changes: 25 additions & 0 deletions leyden/setup.sh
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

0 comments on commit 81d770e

Please sign in to comment.