Tutorial 1
Serve a JPG
You already have a Krazy Kontainer, or the host binary, pointed at a folder. This guide puts one JPEG in that folder and opens it in the browser.
Same binary on Docker, Podman, and Kubernetes. Only the way the file reaches the folder changes.
Pick a picture you own. On the machine that holds the data folder, copy it in. Name it simply.
mkdir -p data
cp ~/Pictures/lake.jpg data/lake.jpg
Windows PowerShell: New-Item -ItemType Directory -Force data; Copy-Item $env:USERPROFILE\Pictures\lake.jpg data\lake.jpg
Start (or reuse) the official box. The volume is the whole trick.
docker pull ghcr.io/crimsonflower420/krazytogo:latest
docker run -d --name krazy \
-p 8080:8080 \
-v "$PWD/data:/data" \
-e KRAZY_ROOT=/data \
-e KRAZY_BROWSE=true \
ghcr.io/crimsonflower420/krazytogo:latest
Open the file. Browse the folder, or hit the name directly.
# browser
http://127.0.0.1:8080/
http://127.0.0.1:8080/lake.jpg
# or from a terminal
curl -fsSI http://127.0.0.1:8080/lake.jpg
$ curl -fsSI http://127.0.0.1:8080/lake.jpg HTTP/1.1 200 OK Content-Type: image/jpeg …
Expected headers include Content-Type: image/jpeg and a 200. If you see 404, the file is not in the mounted folder, or the name does not match.
Done when: you see the photograph at /lake.jpg. The volume is the share — there is no upload button.
Host binary (no runtime): krazytogo -root ./data -addr :8080 with lake.jpg in ./data.
Same flags as Docker. Two differences only: the binary name, and :Z on the volume if the host uses SELinux (Fedora, RHEL, and many server installs).
mkdir -p data
cp ~/Pictures/lake.jpg data/lake.jpg
podman pull ghcr.io/crimsonflower420/krazytogo:latest
podman run -d --name krazy \
-p 8080:8080 \
-v "$PWD/data:/data:Z" \
-e KRAZY_ROOT=/data \
-e KRAZY_BROWSE=true \
ghcr.io/crimsonflower420/krazytogo:latest
Rootless Podman publishing :8080 needs the usual user-port permission. If bind fails, pick a high host port: -p 18080:8080 and open http://127.0.0.1:18080/lake.jpg.
# browser
http://127.0.0.1:8080/
http://127.0.0.1:8080/lake.jpg
# or from a terminal
curl -fsSI http://127.0.0.1:8080/lake.jpg
$ curl -fsSI http://127.0.0.1:8080/lake.jpg HTTP/1.1 200 OK Content-Type: image/jpeg …
Expected headers include Content-Type: image/jpeg and a 200. If you see 404, the file is not in the mounted folder, or the name does not match.
The official Deployment already mounts a PVC at /data. The file has to land on that PVC. You do not docker cp a running scratch container and hope. Use a short-lived helper that mounts the same claim, or kubectl cp into the tools sidecar after Tutorial 2.
kubectl apply -k deploy/kubernetes/
# apply examples/packages/copy-jpg-pod.yaml — a short-lived helper
# that mounts the same PVC at /data (scratch has no shell to copy into)
kubectl -n krazytogo apply -f examples/packages/copy-jpg-pod.yaml
The helper Pod is Alpine + sleep, same claim as the server. If that example file is not in the repo yet, this is the whole manifest:
# examples/packages/copy-jpg-pod.yaml — not the official Deployment
apiVersion: v1
kind: Pod
metadata: { name: copy-jpg, namespace: krazytogo }
spec:
containers:
- name: copy-jpg
image: alpine:3.20
command: ["sleep", "600"]
volumeMounts: [{ name: data, mountPath: /data }]
volumes:
- name: data
persistentVolumeClaim: { claimName: krazytogo-data }
Copy the file in, port-forward the Service, then delete the helper.
kubectl -n krazytogo cp ./lake.jpg copy-jpg:/data/lake.jpg
kubectl -n krazytogo port-forward svc/krazytogo 8080:8080
# browser → http://127.0.0.1:8080/lake.jpg
kubectl -n krazytogo delete pod copy-jpg
Do not kubectl exec into the krazytogo container looking for a shell. Scratch has none. Do not switch the Deployment image to nginx “just to copy a file.” The PVC is the share; any helper that mounts it can write the JPEG.
If Tutorial 2’s tools sidecar is already running, skip the one-shot pod: kubectl -n krazytogo cp ./lake.jpg deploy/krazytogo:/data/lake.jpg -c tools.