I’m getting an error as follows:
#8 46.51 [error] java.lang.IllegalStateException: cannot run sbt from root directory without -Dsbt.rootdir=true; see sbt/sbt#1458
#8 46.51 [error] Use 'last' for the full log.
The Dockerfile is mostly just downloading and installing the debian. But something is making sbt unhappy. Not sure what it is.
FROM openjdk:8 as build
ENV SBT_VERSION "1.5.8"
ENV APP_HOME /service
# Install sbt
RUN
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 &&
sbt sbtVersion
2
Answers
By the look of the error your getting try adding before the
RUN
commandthe end result will be
I believe the issue is using root aka
/
as the working directory. AddingWORKDIR /home
before theRUN ...
command fixes thedocker build ...
error and I was able todocker run ...
successfully.docker build ...
docker run ....
launching to ansbt
console.