Container Example
Docker workflows for Tish programs: compile .tish to Linux x86_64 binaries with glibc, run them in distroless-sized images, and optionally deploy to Zectre as a container app.
Prerequisites
- Docker (Desktop or Engine)
- just (
cargo install justorbrew install just) - Tish language repo on disk (default
../tish, sibling oftish-paas) — used only as the Docker build context forDockerfile.compile. The image is built inside Docker (cargo buildthere); you do not need atishbinary on your PATH forjust setup,just build,just zectre-build-image, etc. - For Zectre: zectre CLI and a cluster with container support enabled on agents
When you do need Rust / a local compiler
Recipes like just build-local run cargo run -p tish … in the Tish repo on your machine. Those need Rust and the ../tish checkout, still not necessarily a global tish install (Cargo runs the crate). Use just build if you want zero host toolchain beyond Docker.
Quick start
# One-time: runtime image (distroless) + compiler image (tish CLI inside Docker)
just setup
# Compile a program to a Linux binary (uses compiler container; default platform linux/amd64)
just build sample.tish ./sample-bin
# Run it in the minimal runtime (binary mounted read-only)
just docker-run ./sample-bin
# HTTP example (src/main.tish): publish host 8080 → container 8080 and set PORT
just build src/main.tish ./server
DOCKER_PORT=8080 just docker-run ./server
# Or one-shot recipes
just example # CLI sample
just example-http # build + run HTTP with port 8080See just --list for all recipes. The justfile header comments mirror this flow.
Which Dockerfile is which?
Flow
Dockerfile.compile→ image that is thetishtool: compile.tish→ Linux glibc binaries inside Docker.Dockerfile/Dockerfile.embedded→ minimal runtime for those binaries on distroless/cc (mount vs bake-in).
Layout
src/console.tish— tiny CLI smoke testsrc/main.tish— HTTP server (serve,/,/health); usesPORTfrom the environment (default8080)zectre.yaml— Zectre manifest (process_type: docker, image name, networking)
Zectre deployments
Zectre agents run docker pull only if the image is not already present locally. A short name like zectre-minimal-container:latest is not on Docker Hub unless you publish it—see zectre.yaml comments and Container deployments.
Local / same host as the agent
just zectre-build-image # build binary + embedded image with tag from ZECTRE_IMAGE
just zectre-deploy --wait # uses ZECTRE_API_URL (default http://localhost:47080)Remote agents
Build, tag, push to GHCR/Docker Hub, set deploy.image in zectre.yaml to the full reference (same idea as container-example).
Environment variables (common)
Language reference
Tish syntax and APIs: LANGUAGE.md in the tish repo.