Skip to content

okaay3D/devcontainer-scala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scala 3 Devcontainer Template

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.


Features

  • 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) and linux/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.

How to Use

With VS Code Locally

  1. Clone your repository to your local machine.
  2. Make sure you have Docker Desktop and the Remote - Containers extension installed in VS Code.
  3. Open the cloned repository folder in VS Code.
  4. 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.


Getting Started with the Code

This template includes a sample application and a test to demonstrate that the environment is working correctly.

Running the Application

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.

Running the Tests

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.


Project Structure

.
├── .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.

About

A ready-to-use development container template for Scala 3 projects using sbt.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published