tuxdock/README.md

131 lines
4 KiB
Markdown
Raw Normal View History

2026-02-25 13:44:27 -05:00
# Tux-Dock
### A lightweight C++ Docker TUI
2025-10-18 23:38:32 +00:00
2026-02-25 13:44:27 -05:00
Tux-Dock is a modern **C++17** Docker terminal frontend built with **FTXUI**.
It gives you a guided, keyboard-first TUI for common Docker operations without memorizing long CLI flags.
2025-10-18 23:38:32 +00:00
---
2026-02-25 13:44:27 -05:00
## Features
2025-10-18 23:38:32 +00:00
2026-02-25 13:44:27 -05:00
- Interactive Docker workflows through a single-screen TUI with modal steps.
- Picker-based selection (arrow keys + Enter) for containers/images instead of numeric menus.
- Busy-operation modals with a spinner and input blocking while Docker work completes.
2026-02-25 13:44:27 -05:00
- Rich container display with state and forwarded ports.
- Interactive shell handoff with clean terminal clear before/after shell transitions.
- Image operations: pull/list/delete with curated quick picks and custom image support.
- Docker Engine API access through `/var/run/docker.sock` for structured list and lifecycle operations.
- Direct `fork`/`exec` process execution for CLI-backed streaming and interactive commands.
- Persistent container listings that retain exited containers.
- Robust stop handling with state polling, timeout retry, and idempotent stop responses.
2026-02-25 13:44:27 -05:00
- About screen in-app with project/version/repository info.
2025-10-18 23:38:32 +00:00
---
2026-02-25 13:44:27 -05:00
## Build Requirements
2025-10-18 23:38:32 +00:00
2026-02-25 13:44:27 -05:00
- **C++17 or newer** compiler (e.g. `g++`, `clang++`)
- **CMake 3.16+**
2025-10-18 23:38:32 +00:00
- **Docker Engine** installed and running
---
2026-02-25 13:44:27 -05:00
## Build & Run
2025-10-18 23:38:32 +00:00
```bash
# Clone the repo
2025-11-03 19:56:19 -05:00
git clone https://mentalnet.xyz/forgejo/markmental/tuxdock.git
2025-10-18 23:38:32 +00:00
cd tuxdock
# Configure, build, and test (FTXUI and nlohmann/json are fetched automatically)
./compile.sh
2025-10-18 23:38:32 +00:00
# Run it (requires Docker permissions)
sudo ./build/tux-dock
# Build without running tests
./compile.sh --no-test
# Run tests and serve an HTML 3.2 report on port 8095
./compile.sh --web-test-view
# Override the report server port
./compile.sh --web-test-view 9000
```
2025-10-18 23:38:32 +00:00
The web report is generated under `/tmp` and includes exact CTest output, test summaries, Docker integration output, and a text rendition of the TUI flow. It requires `nc`, `netcat`, or Nmap's `ncat`; press `Ctrl-C` to stop the server. The default port is `8095`; pass a port after `--web-test-view` to override it. `--web-test-view --no-test` is invalid. Normal test runs include a Docker integration test using `debian:forky`, so Docker must be available. On systems with 1 GB or less of available memory, the script automatically uses a smaller build configuration and a single build job.
2025-11-03 18:30:18 -05:00
2025-10-18 23:38:32 +00:00
---
2026-02-25 13:44:27 -05:00
## Menu Overview
2025-10-18 23:38:32 +00:00
2026-02-25 13:44:27 -05:00
Current TUI actions:
1. Pull Docker Image
2. Create Container
2026-02-25 13:44:27 -05:00
3. List All Containers
4. List All Images
5. Start Detached Container Session
6. Delete Docker Image
7. Stop Container
8. Remove Container
9. Attach Shell to Running Container
10. Run Detached Command in Container
11. About Tux-Dock
12. Exit
2025-10-18 23:38:32 +00:00
---
2026-02-25 13:44:27 -05:00
## Design Overview
2025-10-18 23:38:32 +00:00
Tux-Dock is organized around the TUI, Docker manager, Engine API client, and direct process runner:
2025-10-18 23:38:32 +00:00
2026-02-25 13:44:27 -05:00
### Responsibilities
2025-10-18 23:38:32 +00:00
- `DockerEngineClient`
- Talks directly to Docker over the Unix socket.
- Parses HTTP responses, including chunked and bodyless responses.
- `ProcessRunner`
- Executes direct argument vectors using `fork` and `exec`.
- Supports captured output and inherited terminal I/O.
2026-02-25 13:44:27 -05:00
- `DockerManager`
- Maps Engine API JSON into application data.
- Performs lifecycle operations and robust stop-state confirmation.
- Preserves cached state when refreshes fail.
2025-10-18 23:38:32 +00:00
2026-02-25 13:44:27 -05:00
- `TuxDockApp`
- Renders the FTXUI interface.
- Manages modal flows (input/select/confirm/message).
- Handles modal flows, busy operations, blocked input, and interactive shell transitions.
2026-02-25 13:44:27 -05:00
- Coordinates end-to-end user flows by calling `DockerManager` methods.
2025-10-18 23:38:32 +00:00
2026-02-25 13:44:27 -05:00
This split keeps Docker behavior isolated while making UI behavior easier to extend.
2025-10-18 23:38:32 +00:00
---
## Testing
```bash
cmake -S . -B build -DBUILD_TESTING=ON
cmake --build build
ctest --test-dir build --output-on-failure
```
`compile.sh` runs these tests by default. Pass `--no-test` to skip them.
---
2026-02-25 13:44:27 -05:00
## About / Version
2025-10-18 23:38:32 +00:00
- Version: `0.1.2-beta`
2026-02-25 13:44:27 -05:00
- Created by: `markmental`
- GitHub: https://github.com/MARKMENTAL/tuxdock
- Forgejo: https://mentalnet.xyz/forgejo-v2/markmental/tuxdock
2025-10-18 23:38:32 +00:00
---
2026-02-25 13:44:27 -05:00
## License
2025-10-18 23:38:32 +00:00
2026-02-25 13:44:27 -05:00
MIT License — free to use, modify, and share.