Sign inSign up

swal4u/sbt

By swal4u

•Updated 7 months ago

sbt image with cache dependency

Image
1

5.3K

swal4u/sbt repository overview

⁠How to work with the container SBT

When you start your container, it automatically starts the sbt package command.

⁠Get started

  • Clone the project
git clone https://github.com/swal4u/sbt.git
  • then build the image
cd sbt
docker build -t sbt .

⁠How to use this Docker image

  • Go in the root folder where you have your build.sbt
  • Launch the container to compile your Scala project
docker run -it --rm -v $PWD:/app sbt [compile]
  • Launch the container to test your Scala project
docker run -it --rm -v $PWD:/app sbt test
⁠Deep dive
  • This image is based on hardened docker image Eclipse Temurin JDK 21.
  • This image includes Scala 2.13.18 and SBT.
  • I use sdkman to install sbt and scala.
  • I use multi-stage Docker builds to optimize the image size.
  • I have a default scala project to put in cache the dependencies and compiled artifacts like spark, kafka. If you want to update the dependencies, you need to modify the build.sbt file and rebuild the image.
⁠Alias

Don't forget to create alias on your machine to simplify the usage of this container.

Tag summary

Content type

Image

Digest

sha256:07c95f268…

Size

1.3 GB

Last updated

7 months ago

docker pull swal4u/sbt:1.12.1