There's a branch of this that also sets you up with Selenium, Chrome and Chromedriver in the Docker image!
$ 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"
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 toproject.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.
$ ./gradlew build
$ ./gradlew run
$ ./gradlew buildImage
- 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.