Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What's wrong with this Dockerfile?

FROM openjdk:8 as build
ENV SBT_VERSION "1.5.8"
ENV APP_HOME /service
RUN \
  apt-get update && \
  apt-get install apt-transport-https curl gnupg -yqq && \
  echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list && \
  echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list && \
  curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import && \
  chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg && \
  apt-get update && \
  apt-get install sbt=$SBT_VERSION && \
  sbt sbtVersion

I’m getting an error saying E: Version ‘1.5.8’ for ‘sbt’ was not found

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I had to change my work directory away from default / to get this to work. Try below (WORKDIR changes folder, cd in the commands likely have the same effect) could. This builds and runs with sbt command for me.

FROM openjdk:8 as build
ENV SBT_VERSION "1.5.8"
ENV APP_HOME /service
WORKDIR $APP_HOME
RUN \
  apt-get update && \
  apt-get install apt-transport-https curl gnupg -yqq && \
  echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list && \
  echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list && \
  curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import && \
  chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg && \
  apt-get update && \
  apt-get install sbt=$SBT_VERSION && \
  sbt sbtVersion
root@a94ff4797239:/service# sbt
[info] welcome to sbt 1.5.8 (Oracle Corporation Java 1.8.0_312)
[info] loading project definition from /service/project
[info] set current project to service (in build file:/service/)
[info] sbt server started at local:///root/.sbt/1.0/server/c75bcef1d951ec508da8/sock
[info] started sbt server
sbt:service>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading