https://github.com/tiulpin/dokker
🗂 Yet Another One Way to Handle Your Dockerfiles with Kotlin
https://github.com/tiulpin/dokker
docker docker-templates dockerfile kotlin-library
Last synced: 5 months ago
JSON representation
🗂 Yet Another One Way to Handle Your Dockerfiles with Kotlin
- Host: GitHub
- URL: https://github.com/tiulpin/dokker
- Owner: tiulpin
- License: apache-2.0
- Created: 2021-11-21T10:03:32.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-05T22:08:10.000Z (about 4 years ago)
- Last Synced: 2025-04-07T03:46:13.830Z (about 1 year ago)
- Topics: docker, docker-templates, dockerfile, kotlin-library
- Language: Kotlin
- Homepage: https://tiulpin.github.io/dokker/dokker/[root]/-dokker/index.html
- Size: 361 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🐳 Dokker
The Kotlin DSL to generate your project Dockerfiles with Kotlin.
## Example
The library is created with one purpose: allow easy generation of multiple Dockerfiles with Kotlin.
Check out the example below:
```kotlin
val aptPackages = listOf(
"build-essential",
"python3",
"python3-pip"
)
val environment = mapOf(
"PYTHON_VERSION" to "3.9.6"
)
val ignores = listOf(
".venv"
)
val resources = listOf(
"examples/.python_version"
)
val project = dokker(resources = resources, ignores = ignores) {
from("ubuntu")
arg("platform")
label(
mapOf(
"maintainer" to "viktor@tiulp.in"
)
)
user("root")
env(environment)
kopy(listOf(".python_version"), "/tmp")
run(
listOf(
aptInstall(aptPackages),
"echo ${envBraces("PYTHON_VERSION")}"
)
)
expose(8080)
workdir("/")
entrypoint("python3")
comment("We did it!")
}
project.save("python-example")
```
With the above code, you can generate a project [like this](./example).
## Contribution
Feel free to extend the Dokker with anything you want : create an issue or send a pull request!