Krazy Kontainers
File-server binary + packaging for minimal Go containers. Works for and alongside gokrazy appliances. Honest scope: not a whole gokrazy distro — just serve files, contained.
A Go file server for Krazy Kontainers pure Go · zero CGO GPL-3.0
KrazyToGo is the system to serve files in minimal Go containers —
the file-server binary plus Kontainer packaging, including for and
alongside gokrazy. Same static binary on
Docker, Podman, and
Kubernetes. Pure net/http. Not a whole
gokrazy distro — just files, neatly contained.
Why
The process stays tiny. The data can be a handful of files or a warehouse. Either way, you get the same static binary in a minimal Go container — a Krazy Kontainer — on the runtime you already run.
File-server binary + packaging for minimal Go containers. Works for and alongside gokrazy appliances. Honest scope: not a whole gokrazy distro — just serve files, contained.
Footprint stays small (~5.4 MiB stripped). Mount a tiny config tree or a huge dataset — the Kontainer shape does not care. Process tiny; data your call.
Docker, Podman, and
Kubernetes are first-class ways to contain the
server. Same binary, same flags, same /healthz.
Maintainer’s bet. This is one maintainer’s point of view — what we optimize for: tiny process, honest boundaries, Kontainers on Docker / Podman / Kubernetes, gokrazy-friendly packaging. Other takes welcome — future contributors invited to argue with the defaults.
Features
Point -root (or KRAZY_ROOT) at a directory and go. Directory browsing is optional via -browse.
/healthz for probes, Range requests for resumes. Flags beat env beat defaults — short unit files, clear precedence.
Multi-stage → FROM scratch, non-root UID. Mount a volume, publish a port — same shape under Docker and Podman.
Hardened manifests with PVC, runAsNonRoot, read-only root FS, and /healthz probes under deploy/kubernetes/.
Build with -tags gokrazy (listen :80, root /perm/files). Runs for / alongside gokrazy — not a replacement distro.
No uploads, no WebDAV, no in-app auth, no UI. Pure net/http, no CGO. Auth and TLS live at the edge.
Quick start
/healthzUnder thirty seconds of reading. Copy-paste from the public product README.
go install github.com/crimsonflower420/KrazyToGo/cmd/krazytogo@latest
mkdir -p data && echo hello > data/hello.txt
krazytogo -root ./data -addr :8080
# → http://127.0.0.1:8080/hello.txt
# → http://127.0.0.1:8080/healthz → 200 ok
mkdir -p data && echo hello > data/hello.txt
go run ./cmd/krazytogo -root ./data -addr :8080
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o krazytogo ./cmd/krazytogo
./krazytogo -root ./data -addr :8080
curl -fsS http://127.0.0.1:8080/healthz
# → 200 ok
After any deploy, hit /healthz — probes and humans both get a plain 200 ok.
-root / KRAZY_ROOT./data; /data in images)-addr / KRAZY_ADDR:8080; :80 on gokrazy)-browse / KRAZY_BROWSEPrecedence: flags > env > defaults.
Deploy targets
Docker, Podman, and Kubernetes are equal ways to contain the server. gokrazy stays in the picture as an appliance host you can run for or alongside — packaging, not a whole distro.
Kontainer
Multi-stage → FROM scratch,
USER 65532:65532. Mount content, publish a port.
Same Krazy Kontainer image shape as Podman.
docker build -t krazytogo .
docker run -d -p 8080:8080 \
-v "$PWD/data:/data" \
-e KRAZY_ROOT=/data krazytogo
Kontainer
Same Dockerfile, same scratch image, rootless-friendly. Drop-in commands if you prefer Podman over Docker.
podman build -t krazytogo .
podman run -d -p 8080:8080 \
-v "$PWD/data:/data" \
-e KRAZY_ROOT=/data krazytogo
Kontainer
Hardened manifests under deploy/kubernetes/.
PVC (not hostPath), non-root, read-only root FS, /healthz probes.
kubectl apply -k deploy/kubernetes/
gokrazy note. Build with -tags gokrazy
(listen :80, root /perm/files) when you bake
the binary into an appliance image. Prefer Tailscale for access.
KrazyToGo is the file server + packaging — not a gokrazy distribution.
FAQ
CGO_ENABLED=0, -ldflags=-s -w) on linux/amd64. Stdlib only — no module deps.What this is not
Clarity beats feature creep. If you need the items below, put another component in front of KrazyToGo — don’t wait for them to land in-process.
Support
KrazyToGo is free software under GPL-3.0. If a Krazy Kontainer saves you an afternoon of wiring up yet another “simple” file server, a coffee keeps the maintainer caffeinated and the binary tiny.