Skip to content

Instantly share code, notes, and snippets.

@ianjuma
Created September 8, 2016 10:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ianjuma/c6be08299a8b2a7ece35def1bf358b48 to your computer and use it in GitHub Desktop.
Save ianjuma/c6be08299a8b2a7ece35def1bf358b48 to your computer and use it in GitHub Desktop.
Scala dockerfile
#
# Scala and sbt Dockerfile
#
# https://github.com/hseeberger/scala-sbt
#
# Pull base image
FROM java:8
ENV SCALA_VERSION 2.11.8
ENV SBT_VERSION 0.13.12
# Install Scala
## Piping curl directly in tar
RUN \
curl -fsL http://downloads.typesafe.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.tgz | tar xfz - -C /root/ && \
echo >> /root/.bashrc && \
echo 'export PATH=~/scala-$SCALA_VERSION/bin:$PATH' >> /root/.bashrc
# Install sbt
RUN \
curl -L -o sbt-$SBT_VERSION.deb http://dl.bintray.com/sbt/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
# Define working directory
WORKDIR /root
EXPOSE 1090
ADD medusa.jar /root/medusa.jar
CMD ["java", "-Dcom.sun.management.jmxremote", \
"-Dcom.sun.management.jmxremote.port=1090", \
"-Dcom.sun.management.jmxremote.rmi.port=1090", \
"-Djava.rmi.server.hostname=172.17.0.1", \
"-Dcom.sun.management.jmxremote.local.only=false", \
"-Dcom.sun.management.jmxremote.authenticate=false", \
"-Dcom.sun.management.jmxremote.ssl=false", \
"-XX:+UseConcMarkSweepGC", \
"-Xms128m", \
"-Xmx340m", \
"-jar", \
"/root/medusa.jar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment