Skip to content

cs-cordero/kotlin-gradle-dockerfile-starter

Repository files navigation

A Starter Template for Kotlin-Gradle-Dockerfile setups

There's a branch of this that also sets you up with Selenium, Chrome and Chromedriver in the Docker image!

Setup

$ cd /path/to/Projects
$ git clone --depth 1 https://github.com/cs-cordero/kotlin-gradle-dockerfile-starter.git [your-new-project]
$ cd [your-new-project]
$ rm -r .git
$ git init
$ git add .
$ git commit -m "Bootstrapped from https://github.com/cs-cordero/kotlin-gradle-dockerfile-starter"

Post-Setup

Open the gradle.properties file and change the following values to what you want:

  • name. The project name, used in many places, notably the name of the shadow jar will be "${project.name}-${project.version}.jar"
  • version. The project version, used in many places, notably the name of the shadow jar will be "${project.name}-${project.version}.jar"
  • group. See here.
  • imageRepository. A component of the image tag (repo/name:version)
  • imageName. A component of the image tag (repo/name:version). Defaults to project.name.
  • createLatestTag. If this is set to any value, buildImage will also create a :latest image tag. Remove it entirely if you don't want this.

Commands

$ ./gradlew build
$ ./gradlew run
$ ./gradlew buildImage

Features

  • Comes equipped with a build.gradle.kts that configures a Shadow Jar plugin to include the Kotlin stdlib when creating Jar.
  • Also configures the buildImage task, which will create a Docker image for you.

Author

Christopher Sabater Cordero

About

Get started with Kotlin, Gradle, and Docker quickly

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published