Skip to content

Instantly share code, notes, and snippets.

@RobDWaller
Created April 13, 2020 09:12
Show Gist options
  • Save RobDWaller/63242bdd3c540406c4b86d584ef9765d to your computer and use it in GitHub Desktop.
Save RobDWaller/63242bdd3c540406c4b86d584ef9765d to your computer and use it in GitHub Desktop.
Scala Docker Environment Notes
// Spin up a 'Hello, World!' Scala environment using Docker and Ubuntu
// Docker Compose Config
version: "3"
services:
scala:
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/var/www/html
working_dir: /var/www/html
tty: true
ports:
- "8080:80"
// Dockerfile Config
FROM ubuntu:18.04
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install curl gnupg -y
RUN apt-get install openjdk-8-jdk openjdk-8-jre -y
RUN echo 'JAVA_HOME= /usr/lib/jvm/java-8-openjdk-amd64' >> /etc/environment
RUN echo 'JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre' >> /etc/environment
RUN echo "deb https://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list
RUN curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add
RUN apt-get update && apt-get install sbt -y
// Basic Scala Commands
sbt new scala/hello-world.g8
sbt ~run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment