This commit is contained in:
Hymmel 2025-10-10 15:40:55 +02:00
parent 3380d9a782
commit 75ef031ff2

View file

@ -11,14 +11,17 @@ ENV PATH=${SBT_HOME}/bin:${PATH}
# Install required tools and the specific version of SBT # Install required tools and the specific version of SBT
# The .tgz for 0.13.11 is missing from GitHub releases. We'll install it manually. # The .tgz for 0.13.11 is missing from GitHub releases. We'll install it manually.
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y curl && \ # Install certificates for HTTPS, curl to download, and unzip to verify
apt-get install -y ca-certificates curl unzip && \
mkdir -p "${SBT_HOME}/bin" && \ mkdir -p "${SBT_HOME}/bin" && \
curl -L -o "${SBT_HOME}/bin/sbt-launch.jar" "https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/${SBT_VERSION}/sbt-launch-${SBT_VERSION}.jar" && \ curl -L -o "${SBT_HOME}/bin/sbt-launch.jar" "https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/${SBT_VERSION}/sbt-launch-${SBT_VERSION}.jar" && \
# Verify the downloaded JAR is valid
unzip -t "${SBT_HOME}/bin/sbt-launch.jar" && \
echo '#!/bin/sh' > "${SBT_HOME}/bin/sbt" && \ echo '#!/bin/sh' > "${SBT_HOME}/bin/sbt" && \
echo 'SBT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"' >> "${SBT_HOME}/bin/sbt" && \ echo 'SBT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"' >> "${SBT_HOME}/bin/sbt" && \
echo 'java $SBT_OPTS -jar `dirname $0`/sbt-launch.jar "$@"' >> "${SBT_HOME}/bin/sbt" && \ echo 'java $SBT_OPTS -jar `dirname $0`/sbt-launch.jar "$@"' >> "${SBT_HOME}/bin/sbt" && \
chmod 0755 "${SBT_HOME}/bin/sbt" && \ chmod 0755 "${SBT_HOME}/bin/sbt" && \
apt-get purge -y --auto-remove curl && \ apt-get purge -y --auto-remove curl unzip && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
WORKDIR /app WORKDIR /app