Skip to content

Instantly share code, notes, and snippets.

@doppiomacchiatto
Forked from gyndav/Dockerfile
Created August 6, 2023 20:56
Show Gist options
  • Save doppiomacchiatto/c69cdbdab2ddf7500c00ed7ddd1f5b9b to your computer and use it in GitHub Desktop.
Save doppiomacchiatto/c69cdbdab2ddf7500c00ed7ddd1f5b9b to your computer and use it in GitHub Desktop.
install Scala and sbt on Alpine Linux
FROM openjdk:8u151-jre-alpine
ENV SCALA_VERSION=2.12.4 \
SCALA_HOME=/usr/share/scala
# NOTE: bash is used by scala/scalac scripts, and it cannot be easily replaced with ash.
RUN apk add --no-cache --virtual=.build-dependencies wget ca-certificates && \
apk add --no-cache bash curl jq && \
cd "/tmp" && \
wget --no-verbose "https://downloads.typesafe.com/scala/${SCALA_VERSION}/scala-${SCALA_VERSION}.tgz" && \
tar xzf "scala-${SCALA_VERSION}.tgz" && \
mkdir "${SCALA_HOME}" && \
rm "/tmp/scala-${SCALA_VERSION}/bin/"*.bat && \
mv "/tmp/scala-${SCALA_VERSION}/bin" "/tmp/scala-${SCALA_VERSION}/lib" "${SCALA_HOME}" && \
ln -s "${SCALA_HOME}/bin/"* "/usr/bin/" && \
apk del .build-dependencies && \
rm -rf "/tmp/"*
RUN export PATH="/usr/local/sbt/bin:$PATH" && apk update && apk add ca-certificates wget tar && mkdir -p "/usr/local/sbt" && wget -qO - --no-check-certificate "https://cocl.us/sbt-0.13.16.tgz" | tar xz -C /usr/local/sbt --strip-components=1 && sbt sbtVersion
#!/usr/bin/env bash
export PATH="/usr/local/sbt/bin:$PATH" && apk update && apk add ca-certificates wget tar && mkdir -p "/usr/local/sbt" && wget -qO - --no-check-certificate "https://cocl.us/sbt-0.13.16.tgz" | tar xz -C /usr/local/sbt --strip-components=1 && sbt sbtVersion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment