Skip to content

Commit

Permalink
Update to install sbt on the go
Browse files Browse the repository at this point in the history
  • Loading branch information
tomazed committed Sep 26, 2024
1 parent 1657f7c commit 844c7cb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
18 changes: 16 additions & 2 deletions Dockerfile.build_and_run
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
# STAGE 1: Build the binary
FROM mozilla/sbt AS builder
FROM openjdk:11-jre AS builder

ARG SBT_VERSION=1.6.2

WORKDIR /app
RUN \
mkdir /working/ && \
cd /working/ && \
curl -L -o sbt-$SBT_VERSION.deb https://repo.scala-sbt.org/scalasbt/debian/sbt-$SBT_VERSION.deb && \
dpkg -i sbt-$SBT_VERSION.deb && \
rm sbt-$SBT_VERSION.deb && \
apt-get update && \
apt-get install sbt && \
cd && \
rm -r /working/ && \
sbt sbtVersion
WORKDIR /src
COPY . .
RUN apt-get update && apt-get install -y nodejs npm sbt
RUN apt-get update && apt-get install -y nodejs npm openjdk-11-jdk-headless
RUN sbt -mem 2048 dist
RUN mkdir dist
RUN cd dist && unzip /src/app/jvm/target/universal/*.zip
Expand Down
20 changes: 18 additions & 2 deletions Dockerfile.run
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
FROM mozilla/sbt AS builder
# STAGE 1: Build the binary
FROM openjdk:11-jre AS builder

ARG SBT_VERSION=1.6.2

WORKDIR /app
RUN \
mkdir /working/ && \
cd /working/ && \
curl -L -o sbt-$SBT_VERSION.deb https://repo.scala-sbt.org/scalasbt/debian/sbt-$SBT_VERSION.deb && \
dpkg -i sbt-$SBT_VERSION.deb && \
rm sbt-$SBT_VERSION.deb && \
apt-get update && \
apt-get install sbt && \
cd && \
rm -r /working/ && \
sbt sbtVersion
WORKDIR /src
RUN apt-get update && apt-get install -y nodejs npm sbt
RUN apt-get update && apt-get install -y nodejs npm openjdk-11-jdk-headless

0 comments on commit 844c7cb

Please sign in to comment.