Public | Automated Build

Last pushed: 5 days ago
Short Description
Docker image for Scala and SBT with different version.
Full Description

Scala Docker Image


Introduction

  1. Dockerhub: ysihaoy/scala
  2. Docker image for Scala and SBT project with different version combinations

Supported tags (combinations of Scala and SBT) and Dockerfile links

How to use in your Scala SBT project

  1. Sample of your minimal project structure

    your-scala-project
    │   build.sbt
    │   Dockerfile
    │
    ├───project
    |       build.properties
    |       plugins.sbt
    |
    └───src
       ├───main
       │   │   ...
       │
       └───test
    
  2. Sample of your Dockerfile should be like:

    FROM ysihaoy/scala:2.12.2-sbt-1.0.0.rc2
    
    # caching dependencies
    COPY ["build.sbt", "/tmp/build/"]
    COPY ["project/plugins.sbt", "project/build.properties", "/tmp/build/project/"]
    RUN cd /tmp/build && \
     sbt compile && \
     sbt test:compile && \
     rm -rf /tmp/build
    
    # copy source code
    COPY . /root/app/
    WORKDIR /root/app
    RUN sbt compile && sbt test:compile
    
    CMD ["sbt"]
    

Optimisation of the build

In order to have fast CI (continuous integration) build process, sample of your project/build.properties and build.sbt should be like:

  1. project/build.properties

    sbt.version = 1.0.0-RC2
    
  2. build.sbt

    scalaVersion := "2.12.2"
    

You are an awesome Scala developer :-)

Docker Pull Command
Owner
ysihaoy
Source Repository

Comments (0)