Tutorials

Three short jobs after the first run. The file-server process stays small. The volume and a helper Kontainer do the rest.

Official image: ghcr.io/crimsonflower420/krazytogo:latest. Scratch. Non-root. No shell, no apt, no sshd. The volume / PVC is the share. Helpers sit beside it.

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.

Copy a JPG into data/
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 — run the official box
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.

Open / 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 -I
$ 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.

Add apt, dnf, yum, zypper, pacman, or pip

You cannot install packages inside the official Krazy Kontainer. The box is a static file-server binary, a non-root user, and the folder you mount.

If you need apt, dnf, yum, zypper, pacman, or pip, run a second Kontainer that already has that tool. Share the volume. Leave the official image tiny.

Pick one manager. You do not run all six at once. Swap the image and the install line for the manager you want. The helper starts, installs, does one job on /data, and exits.

WantHelper imageInstall command
aptdebian:bookworm-slimapt-get update && apt-get install -y
dnffedora:41dnf install -y
yumrockylinux:9yum install -y
zypperopensuse/leap:15.6zypper --non-interactive install
pacmanarchlinux:basepacman -Sy --noconfirm
pippython:3.12-slimpip install --no-cache-dir

yum on Rocky / Alma / RHEL 8+ is a dnf wrapper. Teaching both names is fine. apk is the smallest helper in examples/packages/ — not the headline here.

One-shot helpers (pick one)
# apt — Debian
docker run --rm -v "$PWD/data:/data" debian:bookworm-slim \
  sh -c 'apt-get update && apt-get install -y --no-install-recommends file && file /data/*'

# dnf — Fedora
docker run --rm -v "$PWD/data:/data" fedora:41 \
  sh -c 'dnf install -y file && file /data/*'

# yum — Rocky Linux
docker run --rm -v "$PWD/data:/data" rockylinux:9 \
  sh -c 'yum install -y file && file /data/*'

# zypper — openSUSE Leap
docker run --rm -v "$PWD/data:/data" opensuse/leap:15.6 \
  sh -c 'zypper --non-interactive install file && file /data/*'

# pacman — Arch
docker run --rm -v "$PWD/data:/data" archlinux:base \
  sh -c 'pacman -Sy --noconfirm file && file /data/*'

# pip — Python packages, not distro packages
docker run --rm -v "$PWD/data:/data" python:3.12-slim \
  sh -c 'pip install --no-cache-dir pillow && python -c "import PIL; print(PIL.__version__)"'

Compose overlay (stays running). From the repository root, with compose.yaml already defining the official krazytogo service:

Compose — apt profile
export PACKAGES="curl file"
docker compose -f compose.yaml \
  -f examples/packages/compose.packages.yaml \
  --profile apt up -d

docker compose -f compose.yaml \
  -f examples/packages/compose.packages.yaml \
  --profile apt exec tools-apt \
  sh -c 'curl -fsS http://127.0.0.1:8080/healthz && ls -l /data'

Change --profile apt to dnf or pacman for those helpers. The helper uses network_mode: service:krazytogo, so curl to :8080 is localhost inside the tools box.

Windows PowerShell: $env:PACKAGES = "curl file" then the same docker compose line.

Custom image (allowed, not upstream): examples/packages/custom-image/ copies the official binary onto Alpine, Debian, or Fedora. You tag it myorg/…. You maintain a Linux distribution. The project will not.

Done when: you ran file or curl or pip from a helper and saw /data. You did not docker exec the official container.

Install SSH and move a JPG into the share

Tutorial 1 already serves whatever sits in the data folder. This guide moves a JPEG into that folder from another machine.

Install SSH on the machine that holds the folder — or in a helper Kontainer next to KrazyToGo. Copy the file in. Refresh /lake.jpg. Do not install sshd in the official scratch image.

Path A — SSH on the host (teach this first)

This is the path a beginner should finish. The file-server box does not change.

Confirm ssh and scp
# macOS / Linux
ssh -V
command -v scp

# Windows PowerShell — add Optional Feature “OpenSSH Client” if missing
Get-Command ssh, scp

From the machine that has the photograph, copy it into the share. Replace user, host, and path.

scp into the data folder
# run this on the laptop that holds the camera roll
scp ./lake.jpg user@server.example:/home/user/krazy/data/lake.jpg

Confirm the running server sees it. Same URLs as Tutorial 1. If KrazyToGo is already running against that folder, there is nothing to restart.

Confirm
curl -fsSI http://127.0.0.1:8080/lake.jpg
# browser → http://127.0.0.1:8080/lake.jpg
curl -I
$ 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.

Path B — OpenSSH client in a helper Kontainer

Use this when the host should stay free of extra tools, or when you just finished Tutorial 2 and already like helpers.

Helper with openssh-client
# Docker — pull a file FROM a remote host INTO the share
docker run --rm -v "$PWD/data:/data" debian:bookworm-slim \
  sh -c 'apt-get update && apt-get install -y --no-install-recommends openssh-client && \
         scp user@photos.example:lake.jpg /data/lake.jpg'
Longer-lived helper (apt profile)
export PACKAGES="openssh-client"
docker compose -f compose.yaml -f examples/packages/compose.packages.yaml --profile apt up -d
docker compose -f compose.yaml -f examples/packages/compose.packages.yaml --profile apt \
  exec tools-apt scp user@photos.example:lake.jpg /data/lake.jpg

Mounting ~/.ssh into the helper is the usual way to give it keys. Keep that mount read-only. Do not paste private keys into a Dockerfile.

Helper with keys mounted read-only
docker run --rm \
  -v "$PWD/data:/data" \
  -v "$HOME/.ssh:/root/.ssh:ro" \
  debian:bookworm-slim \
  sh -c 'apt-get update && apt-get install -y --no-install-recommends openssh-client && \
         scp user@photos.example:lake.jpg /data/lake.jpg'

Path C — sshd as a helper (optional, not default)

Only if you want other machines to push into the share with sftp. This is a second Kontainer that publishes port 2222, not the file-server process.

sshd helper on :2222
docker run -d --name krazy-ssh \
  -p 2222:22 \
  -v "$PWD/data:/data" \
  linuxserver/openssh-server

Then from the laptop: scp -P 2222 ./lake.jpg user@server.example:/data/lake.jpg. Point the docs at linuxserver/openssh-server (or equivalent) for keys. Do not write a from-scratch sshd hardening guide here.

Do not do this to the official image

  • Do not docker exec the Krazy Kontainer looking for sshd.
  • Do not docker commit after apt-get install openssh-server.
  • Do not add openssh-server to the upstream Dockerfile.
  • Do not publish port 22 on the file-server container. Port 8080 is the product.

Done when: lake.jpg that started on another machine is visible at the same URL as Tutorial 1. You can say whether you used host scp, a helper client, or kubectl cp. You did not install SSH in the official Krazy Kontainer.

Go krazy with these Kontainers — and leave the toolkit on the other side of the wall.