A `kiri machine` keeps its work in its container's writable layer, so a
routine `docker system prune` with the machine stopped deleted it and
everything in it. container_prune now leaves containers labelled
dev.kiri.machine out, as OrbStack's prunes leave its machines alone;
`kiri machine delete` and `docker rm machine-NAME` still remove one.
The window's prune goes through the same endpoint.
Unit test in daemon/ops.rs, e2e check machine-prune-keeps, listed in
tests/regressions.tsv; docs/features.md says prunes keep machines.
## What this changes and why
Fixes#118.
Docker Hub pulls try the configured mirrors first, in order, then Docker Hub itself. The image keeps the name it was asked for (`docker images` still shows `alpine:latest`), a mirror is asked — and its layers fetched — with no credentials so a Hub sign-in never leaves for a third party, and a mirror that has no image or does not answer says why in the pull output and falls back. Other registries are pulled directly, and pushes never go through a mirror. That is Docker's `registry-mirrors` semantic: the list is Hub-only.
- `~/.kiri/registry-mirrors.json` (`GET`/`POST /kiri/registry-mirrors`), the daemon's, so macOS, Windows and Linux share one implementation.
- Settings → Registry mirrors: add, remove, save, on all three systems.
- `kiri registry-mirror list | add ADDRESS | remove ADDRESS`; on Windows `kiri.exe` forwards it into WSL.
- `docker build`: the mirrors are merged into the generated `buildkitd.toml` after Kiri's own build mirror, and an idle builder is stopped so the next build reads the new file.
- First run survives a blocked Hub: the setup wizard's test container is best-effort, and the ready screen points at Settings → Registry mirrors if it could not run.
No new dependencies and no background process. The field's example is a neutral `https://mirror.example.com`, and the words are in all language files.
## How you tested it
```text
$ cargo test -p kiri-image # in the fork's GitHub Actions, run 42787435140
$ cargo test -p kiri registry_mirrors
$ cargo test -p kiri --no-run
all passing
$ python3 scripts/i18n-check.py
PASS 1631 keys, 15 language file(s), 0 problem(s)
$ python3 scripts/ui-test.py
PASS, including tests/ui/mirrors.js and the macOS/Windows/Linux parity pass
```
On Windows 10 22H2 (19045), x86-64: built the MSI from this branch through the fork's CI, installed it, added a mirror in Settings; `docker pull alpine` went through it and kept the name, `kiri registry-mirror list` showed it, and `docker build` with `FROM alpine` used it.
`cargo fmt` and `cargo clippy` were not run: this machine has no Rust toolchain, so the Rust tests run in GitHub Actions. The daemon, image client and page are shared code, but I only ran Kiri on Windows; the page tests cover the macOS and Linux layouts.
Tested on: Windows 10 22H2, x86-64
## How you found it
- [x] I use Kiri and ran into this myself
- [ ] I found it by reading the code or comparing with Docker
- [ ] Someone else reported it (link the issue above)
AI tools used to write this change: yes — the Rust, page and test code was drafted with ZCode (an AI coding assistant) and reviewed and tested by the author.
## Checklist
- [x] I have at most 3 pull requests open on Kiri, this one included
- [ ] `cargo fmt`, `cargo clippy` and the tests pass — tests pass in CI; fmt and clippy were not available here
- [ ] It works on macOS, Windows and Linux, or the change only touches one of them — shared code, Windows tested on a real machine, page parity covers the other two
Co-authored-by: MY Li <lmy3520@live.com>