These libraries are experimental. APIs may change without notice. Generated from source with koruc 0.1.7 on 8/19/2026.

Docker

@korulang/docker@0.0.1

Docker DSL for Koru - declarative images, typed container lifecycle

docker/index.kz · 8 tors

@korulang/docker - Docker DSL for Koru · 28 more lines
@korulang/docker - Docker DSL for Koru Declarative image definitions and typed container lifecycle. Phantom obligations ensure containers are properly stopped. DECLARATIVE IMAGES: ~koru/docker:image(tag: "myapp:latest") { FROM alpine:3.18 COPY zig-out/bin/main /usr/local/bin/myapp CMD ["myapp"] } CONDITIONAL IMAGES (build flags): ~[build("prod")]koru/docker:image(tag: "myapp:latest") { FROM alpine:3.18 COPY zig-out/bin/main /usr/local/bin/myapp CMD ["myapp"] } ~[build("dev")]koru/docker:image(tag: "myapp:latest") { FROM alpine:3.18 RUN apk add --no-cache gdb strace COPY zig-out/bin/main /usr/local/bin/myapp CMD ["myapp", "--debug"] } Then run: koruc main.kz --build=prod docker build This generates Dockerfiles and builds all declared images matching the flag.

Phantom lifecycles

Derived from the phantom labels in the declarations below — state! issues an obligation the compiler will chase, !state discharges it, a bare state holds it without moving it. Nothing here is hand-drawn.

Container 1 state running!

docker

comptimecommand index.kz:54

image

comptimenorun index.kz:241

run

<running!> index.kz:279

stop

<!running> index.kz:326

kill

<!running> index.kz:350