A ready-to-use development container template for Scala 3 projects using sbt
. This template provides a complete, consistent, and reproducible development environment that works on both ARM64 (e.g., Apple Silicon) and x86-64 machines.
It's perfect for getting started with a new Scala project quickly, without worrying about local setup. Use it with GitHub Codespaces or locally with VS Code Remote - Containers.
- Scala 3: Pre-configured for the latest version of Scala.
- sbt: Includes the Scala Build Tool for dependency management and running tasks.
- ScalaTest: Comes with ScalaTest already set up as a test dependency.
- JDK 17: Based on the
eclipse-temurin
JDK, a modern and reliable choice. - Multi-Architecture: The Dockerfile is built to run seamlessly on both
linux/amd64
(x86) andlinux/arm64
(ARM) hosts. - VS Code Ready: Includes recommended extensions for an optimal Scala development experience with Metals.
- Example Code: Contains a sample application and a test to get you started immediately.
- Clone your repository to your local machine.
- Make sure you have Docker Desktop and the Remote - Containers extension installed in VS Code.
- Open the cloned repository folder in VS Code.
- A notification will appear asking if you want to "Reopen in Container". Click it.
VS Code will then build the Docker image and connect your editor to the running container.
This template includes a sample application and a test to demonstrate that the environment is working correctly.
Open the terminal in VS Code and run the following command:
sbt run
This will compile and execute the sample UserAnalysis.scala
file located in src/main/scala
.
To run the sample test case, use this command in the terminal:
sbt test
This will compile and run the SimpleTest.scala
file located in src/test/scala
. You should see output indicating that all tests have passed.
.
├── .devcontainer/ # Contains the devcontainer configuration
│ ├── devcontainer.json
│ └── Dockerfile
├── .gitignore # Specifies files to ignore for Git
├── build.sbt # sbt build definition (dependencies, Scala version)
├── README.md # This file
└── src/
├── main/
│ └── scala/ # Your main application code
└── test/
└── scala/ # Your test code
Note: This template was created almost entirely with Google's Gemini 2.5 Pro.