Skip to content

Commit

Permalink
Dynamically set JAVA_HOME based on amd64 or arm64 architecture (#1)
Browse files Browse the repository at this point in the history
- Update Dockerfile to dynamically set JAVA_HOME based on the system architecture
- Ensure correct JAVA_HOME setting for both amd64 (Intel Mac, Windows) and arm64 (Apple M1, ARM-based systems) architectures
- Add environment variable handling to support architecture-specific JAVA_HOME paths
  • Loading branch information
mayank1211 authored Jun 12, 2024
1 parent ac0021f commit a508a6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ ENV DOCKER_TAG="latest"
ARG SFRUNNER_VER
ENV SFRUNNER_VER="${SFRUNNER_VER}"

ENV JAVA_HOME=/usr/lib/jvm/temurin-20-jdk-arm64
# Find the Java installation path and set it to an environment variable, then export it
RUN JAVA_HOME=$(find /usr/lib/jvm/ -name "temurin-20-jdk*" -type d | head -n 1) && \
echo "export JAVA_HOME=$JAVA_HOME" >> /etc/profile

WORKDIR /

0 comments on commit a508a6a

Please sign in to comment.