Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Base project to build lightweight docker images for Scala applications.

This project uses Google's Jib Maven Plugin which creates small best-pratice docker images for many languages.


The Jib plug-in is only available for Maven or Gradle and offers no SBT version. As I am more familiar with Maven I chose this one.

Background on Jib

Based on: akka/akka-http-quickstart-scala


As we are using Maven to build the Scala application the configuration is straight forward. The only mandatory item is mainClass as the plug-in will not be able to automatically find it for Scala code.


Building a local docker image

mvn clean compile jib:dockerBuild

Running Application in Docker

docker run -p 8080:8080 scala-maven:1.0.0-SNAPSHOT


Server online at

Testing the application

I am using httpie for testing.

Creating a new user

http POST name=Bill age:=50 countryOfResidence=France
HTTP/1.1 201 Created
Content-Length: 36
Content-Type: application/json
Date: Sun, 03 Feb 2019 12:38:22 GMT
Server: akka-http/10.1.7

    "description": "User Bill created."

Retrieving all users

http GET
HTTP/1.1 200 OK
Content-Length: 66
Content-Type: application/json
Date: Sun, 03 Feb 2019 12:38:33 GMT
Server: akka-http/10.1.7

    "users": [
            "age": 50,
            "countryOfResidence": "France",
            "name": "Bill"
You can’t perform that action at this time.