@@ -7,60 +7,25 @@ Containerfiles, Quadlet systemd units, lock files, desktop entries — derives
77from this one file. The user never writes a raw Containerfile or systemd unit
88manually.
99
10- ```
11- Definition File (myenv.toml)
12- │
13- ▼ podbox build
14- ┌──────────────────┐ ┌─────────────────────────────────┐
15- │ Containerfile │ │ Quadlet files │
16- │ (generated) │ │ myenv.build │
17- │ │ │ myenv.socket │
18- └──────┬───────────┘ │ myenv.container │
19- │ └──────────────┬──────────────────┘
20- ▼ │
21- podman build podbox enable
22- │ │
23- ▼ ▼
24- localhost/podbox-myenv:latest systemctl --user daemon-reload
25- │ systemctl --user enable --now myenv
26- └──────────────────────────────────┘
27- │
28- ▼ container starts
29- catatonit (PID 1, via --init)
30- │
31- podbox-guest --entry
32- ├── fork → podbox-guest --daemon
33- │ connects to host socket
34- └── exec → bash / fish (user shell)
35- ```
10+ <p align =" center " >
11+ <picture >
12+ <source media="(prefers-color-scheme: dark)" srcset="assets/how_it_works.svg">
13+ <img src="assets/how_it_works.svg" alt="How podbox Works" width="100%" style="max-width: 820px;">
14+ </picture >
15+ </p >
3616
3717## Codegen Pipeline
3818
3919` podbox build ` runs these steps in order. Each codegen step is a ** pure function** :
4020data in, string out, no I/O. Orchestration (file writes, podman invocations) is
4121separate.
4222
43- ```
44- Config struct
45- │
46- ├── codegen::containerfile::generate(config, guest_binary_path) → String
47- │
48- ├── codegen::quadlet::generate_build(config, containerfile_path) → String
49- │
50- ├── codegen::quadlet::generate_socket(config) → String
51- │
52- ├── codegen::quadlet::generate_container(config, host_env, xdg_dirs) → String
53- │ (queries podman_version() internally for SSH agent gating)
54- │
55- └── lock::write(config_checksum, image_digest) → LockFile
56-
57- Then (I/O phase):
58- write build context to ~/.local/share/podbox/<name>/
59- copy podbox-guest binary into build context
60- podman build -t localhost/podbox-<name>:latest <context-dir>
61- get digest via podman inspect
62- write lock file
63- ```
23+ <p align =" center " >
24+ <picture >
25+ <source media="(prefers-color-scheme: dark)" srcset="assets/codegen_pipeline.svg">
26+ <img src="assets/codegen_pipeline.svg" alt="Codegen Pipeline" width="100%" style="max-width: 820px;">
27+ </picture >
28+ </p >
6429
6530## Generated Containerfile
6631
@@ -144,19 +109,12 @@ The guest daemon connects to a Unix socket on the host to bridge container
144109capabilities. Messages are length-prefixed JSON (see [ protocol.md] ( protocol.md )
145110for the wire format).
146111
147- ```
148- Container process
149- │ runs: notify-send "hello"
150- ▼
151- Interceptor symlink → podbox-guest (re-exec)
152- │ connects to local daemon socket
153- │ sends: {"type":"notify","summary":"hello"}
154- ▼
155- podbox-guest --daemon (event loop)
156- │ forwards to host socket
157- ▼
158- Host socket handler → desktop notification appears
159- ```
112+ <p align =" center " >
113+ <picture >
114+ <source media="(prefers-color-scheme: dark)" srcset="assets/socket_protocol.svg">
115+ <img src="assets/socket_protocol.svg" alt="Host-Guest Socket Protocol" width="100%" style="max-width: 820px;">
116+ </picture >
117+ </p >
160118
161119## Guest Daemon (podbox-guest)
162120
@@ -194,39 +152,12 @@ through the idmapped mount.
194152
195153## Runtime Flow (Full Sequence)
196154
197- ```
198- LOGIN
199- │
200- ▼
201- systemd --user starts myenv.socket
202- creates: /run/user/1000/podbox/myenv.sock
203- │
204- ▼ (autostart=true)
205- systemd --user starts myenv.service (from myenv.container)
206- │
207- ▼
208- podman run --init --name myenv \
209- -v ~/containers/myenv:/root:Z \
210- -v ~/Documents:/root/Documents:z \
211- -v /run/user/1000/wayland-0:/run/user/1000/wayland-0 \
212- -v /run/user/1000/podbox/myenv.sock:/run/user/1000/podbox/myenv.sock \
213- ... localhost/podbox-myenv:latest
214- │
215- ▼
216- catatonit (PID 1) → podbox-guest --entry
217- │
218- ├── fork → podbox-guest --daemon
219- │ ├── connect to host socket
220- │ ├── handshake
221- │ ├── install interceptors
222- │ └── event loop
223- │
224- └── exec → bash (user shell)
225- │
226- │ user runs: notify-send "build done"
227- ▼
228- interceptor → daemon → host socket → notification
229- ```
155+ <p align =" center " >
156+ <picture >
157+ <source media="(prefers-color-scheme: dark)" srcset="assets/runtime_flow.svg">
158+ <img src="assets/runtime_flow.svg" alt="Runtime Flow Sequence" width="100%" style="max-width: 820px;">
159+ </picture >
160+ </p >
230161
231162## Project Structure
232163
0 commit comments