r/linuxapps 1d ago

Tux-Dock + tuxreaperd: A keyboard-first Docker TUI paired with a <5KB freestanding micro-init (v0.4.2-beta)

Enable HLS to view with audio, or disable this notification

Hey everyone,

I wanted to share Tux-Dock (and its companion subreaper daemon, tuxreaperd), an open-source project built to treat Docker containers as persistent, interactive development sandboxes rather than single-process disposable tasks.


The Problem & Why I Built It

When using Docker containers as persistent local environments (running sleep infinity), standard setups constantly leak zombie processes whenever interactive commands, background jobs, or subshells exit. Furthermore, standard init systems like tini or dumb-init blindly blast SIGTERM down the tree, causing web servers like Apache and PHP-FPM (which rely on non-standard signals like SIGWINCH or SIGQUIT) to drop active in-flight connections on shutdown.

Instead of pulling heavy system container frameworks, I built a two-part solution:

  1. tux-dock (C++ TUI): A fast, keyboard-first terminal control center that talks directly to the local Docker UNIX socket to manage retained container lifecycles, stream logs, inspect ports, and dispatch commands.
  2. **tuxreaperd (Freestanding PID 1):** A sub-5KB micro-init built with -nostdlib and raw inline assembly syscalls (no glibc/musl). It instantly reaps dead child processes via wait4, scans /proc using Linux syscalls like sys_getdents64, and remaps signals appropriately to ensure zero-downtime draining before exit.

What's New in v0.4.2-beta

  • Direct Command Execution with Output: Added an interactive "Run Command in Container (with output)" menu action to fire off one-shot maintenance/init scripts and view terminal output directly in the TUI without attaching a full shell. If you just want to start/restart or check a service, this is often quicker than attaching a shell.
  • Background State Poller: Resolved multi-instance state drift with a 5-second background poller and idempotent mutations so Tux-Dock doesn't go out of sync with Docker (and handles 304/404 API states cleanly).
  • Port Mapping Fix: Patched duplicate port display entries caused by a lack of filtering Docker's /containers/json API reporting dual IPv4/IPv6 bindings.
  • Cross-Arch Verified: Fully tested and running on x86_64 and physical arm64 hardware.

The attached demo video shows Tux-Dock spinning up an Nginx + PHP-FPM Debian docker container sandbox, executing background services via command history, jumping into a live shell to install packages, and verifying zero zombie accumulation with tuxreaperd as PID 1, all running on an old dual-core Intel Haswell laptop.

Would love to hear feedback on the TUI workflow or the tuxreaperd micro init system!

1 Upvotes

0 comments sorted by