Skip to content

Doki v0.11.1 — Cross-Arch Emulation, Termux UX, Runner Refactor, Docs

Choose a tag to compare

@awa-omg awa-omg released this 25 Jun 23:56
· 92 commits to main since this release

Doki v0.11.1 — Cross-Arch Emulation, Termux UX, Runner Refactor, Docs

Breaking Changes

  • api.NewServer now returns (*Server, error) to propagate Podman shim init errors.
  • podman.NewPodmanServer, NewPodManager, NewSecretManager, NewManifestManager now return (*T, error) (fail-fast on store creation).
  • macos.SelectBackend now returns (Backend, error).

Cross-Architecture Emulation (pkg/emulation/config.go, 198 lines)

  • doki emu {show,detect,set,test} — 4 new CLI subcommands.
  • Three backends: QEMU user-mode (qemu-x86_64-static, qemu-aarch64-static), FEX-Emu (FEXInterpreter for x86-on-ARM), Box64 (lightweight x86_64 emulator).
  • ~/.doki/emulation.json — persistent config with atomic writes (tmp+rename, 0600 permissions).
  • DOKI_EMULATION_MODE / DOKI_EMULATOR — environment variable override (env wins over disk).
  • emulation.PreferredMode(), NormalizeMode(), Detect(), SelectBest() — full public API for emulator lifecycle.
  • 4 unit tests: TestNormalizeMode, TestSaveLoadPreferredMode, TestPreferredModeEnvWins, TestSelectBest.
  • Container images with foreign architectures (e.g. linux/amd64 on ARM64) are automatically routed through the selected emulator by the runner registry.

Runner Registry Refactor (pkg/runtime/registry.go)

  • BestFor() algorithm rewritten: requestedRuntime() → workload-specific → emulation preference → priority ladder → native fallback.
  • DOKI_RUNTIME environment variable support (was previously ignored). Forces a specific runner.
  • runnerUsableOnHost() — validates RootRequired, KVMRequired, and architecture compatibility before selecting a runner.
  • preferredEmulationRunner() — routes foreign-arch images via QEMU/FEX/Box64 based on emulation.PreferredMode().
  • 5 new tests: TestRegistryBestForUsesEnvRuntime, TestRegistryBestForChoosesHighestUsableLevel, TestRegistryBestForSkipsUnavailableHostRequirements, TestRegistryBestForCrossArchPrefersEmulation, TestRegistryBestForUsesQEMUPreference.

Daemon Host Addressing (cmd/dokid/main.go)

  • --host flag with Docker-style format: unix:///path, tcp://addr:port, bare /path, or addr:port.
  • applyDaemonHost() — parses unix://, tcp://, and bare formats into socketPath/tcpAddr. Supports DOKI_HOST and DOCKER_HOST environment variables.
  • firstNonEmpty() helper for flag/env priority resolution.
  • 1 new test: TestApplyDaemonHost (three parsing paths: unix://, tcp://, bare /path).

Termux Rootless Networking UX (Issue #5 follow-up)

  • pkg/deps/checker.go: termuxNetworkHint() — on Termux, shows "not available (requires root + /dev/net/tun)" instead of misleading "pkg install passt". Uses common.IsTermux() guard.
  • pkg/network/manager.go: setupRootlessNetworking() fallback INFO message now Termux-specific — explains the /dev/net/tun + CAP_NET_ADMIN limitation explicitly.
  • pkgNameMap: pasta and slirp4netns removed from the pkg (Termux) package map entries — prevents doki deps install pasta from running pkg install passt which would fail.
  • 1 new test: TestSetupRootlessNetworking_Fallback — verifies the no-tools-available fallback path returns nil without panic.

Bug Fix — Issue #5 (46e7fb0)

  • pkg/runtime/runtime.go: logChownError() — chown EPERM in rootless mode now emits a single INFO message ("chown skipped in rootless mode") instead of hundreds of WARN lines. Non-EPERM errors remain WARN. ENOENT (broken symlinks in busybox) silently ignored.
  • pkg/network/manager.go: setupRootlessNetworking() now tries pastaslirp4netns → host netns fallback. Previously hard-crashed when pasta was not found.
  • cmd/doki/main.go: dispatch() for subcommands now uses handleError() instead of raw fmt.Fprintf(os.Stderr, "Error: %v\n", err); os.Exit(1). ExitError{Code: 0} no longer prints "Error:".
  • Reproduced and verified on Termux/Android 12 aarch64 with alpine:latest.

Documentation

  • README.md: restored to v0.10.0 detail level (1243 lines) — Comparison table, Features, Quick Start, Binaries, Architecture, CLI commands, Dokifile Builder, Compose, REST API, Networking, DokiLink Mesh, DNS, Storage, Security, Configuration, Building, Project Structure, Compatibility, What is New, Contributing, Links.
  • 22 wiki pages rewritten in clean systems-engineering style (zero emojis, zero SVG assets, zero ASCII box-drawing diagrams).
  • 7 SVG files deleted from .github/assets/ (banner.svg, comparison.svg, divider.svg, footer.svg, performance.svg, platforms.svg, wave.svg).
  • Domain: doki.opceanai.comdok1.xyz across README, wiki, and CI workflows.
  • README.es.md badge updated to v0.11.1; domain updated.

Dependencies

  • pkg/deps/checker.go: new import github.com/OpceanAI/Doki/pkg/common for common.IsTermux().
  • pkg/runtime/registry.go: new import github.com/OpceanAI/Doki/pkg/emulation for emulation.PreferredMode().
  • pkg/emulation/config.go: new package, depends on github.com/OpceanAI/Doki/pkg/common.
  • No new external dependencies added to go.mod.

Quality Metrics

Metric v0.11.0 v0.11.1
Files 165 177
New packages pkg/emulation
CLI commands 108 112 (+4 doki emu)
Test files ~32 41+ (+9 new tests)
README lines 211 1243
Wiki pages 22 22 (rewritten)
go vet 0 0
staticcheck 0 0
Binaries 42 42 (rebuilt)
Release assets 61 72

Known Limitations

  • Emulation backends are detected but not validated on real hardware (QEMU user-mode, FEX-Emu, Box64). Detection code works; runtime paths are wired but untested.
  • DOKI_EMULATION_MODE requires daemon restart for the runner registry to pick up the change.
  • On Termux, neither pasta nor slirp4netns are functional (require /dev/net/tun + CAP_NET_ADMIN). The container shares the host network namespace via proot — functional but not isolated.
  • README.es.md remains at 329 lines (brutalist short form). The full English README is 1243 lines.

Security

  • emulation.json: stored with 0600 permissions and atomic write (tmp+rename) to prevent partial writes.
  • logChownError(): prevents log injection from OCI file paths (uses structured slog logging).
  • All chown/lchown errors now pass through a centralized logChownError() function with EPERM/ENOENT classification.

Install / Upgrade

# ARM64 (most Android devices, Apple Silicon, Linux ARM servers)
curl -L https://github.com/OpceanAI/Doki/releases/download/v0.11.1/doki-android-arm64 -o doki
curl -L https://github.com/OpceanAI/Doki/releases/download/v0.11.1/dokid-android-arm64 -o dokid
chmod +x doki dokid

# Verify
dokid --version
doki version
doki-kube version
doki-kubectl version

Building from Source

git clone https://github.com/OpceanAI/Doki.git
cd Doki
git checkout v0.11.1
make release

Full changelog: v0.11.0...v0.11.1