Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 6 days 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 (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-05T22:08:10.000Z (over 2 years ago)
- Last Synced: 2024-11-02T07:51:28.770Z (about 2 months 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: 2
- Forks: 1
- Open Issues: 2
-
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 "[email protected]"
)
)
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!