# ๐Ÿง Tux-Dock ### A lightweight C++ Docker management CLI Tux-Dock is a simple, modern, and fast **C++17** command-line utility for managing Docker containers and images. It offers a clean, interactive menu for common Docker operations like pulling images, running containers, and inspecting IP addresses โ€” without the overhead of complex GUIs or scripts. --- ## โœจ Features - ๐Ÿ”น **Interactive container management** โ€” start, stop, remove, or attach to containers with simple numbered menus. - ๐Ÿ”น **Port mapping made clear** โ€” automatically prompts for and explains host โ†” container port bindings. - ๐Ÿ”น **Image operations** โ€” pull, list, and delete Docker images. - ๐Ÿ”น **Script-to-image workflow** โ€” turn a bash setup script into a Dockerfile and build the resulting image in one go. - ๐Ÿ”น **Quick MySQL setup** โ€” spin up a MySQL container with version, password, and port configuration in seconds. - ๐Ÿ”น **Get container IP address** โ€” cleanly retrieves and displays only the containerโ€™s assigned IP. - ๐Ÿ”น **Run detached commands** โ€” execute background jobs inside a container without attaching an interactive shell. - ๐Ÿ”น **Modern C++ design** โ€” built with classes, minimal dependencies, and clear abstractions. --- ## ๐Ÿงฉ Build Requirements - **C++17 or newer** compiler (e.g., `g++`, `clang++`) - **Docker Engine** installed and running (tested on Debian 12/13, Alpine Linux, and Arch Linux) --- ## โš™๏ธ Build & Run ```bash # Clone the repo git clone https://mentalnet.xyz/forgejo/markmental/tuxdock.git cd tuxdock # Build the binary g++ -std=c++17 main.cpp -o tux-dock # Run it (requires Docker permissions) sudo ./tux-dock ```` Prefer a prebuilt binary? The CI runner publishes build artifacts for the latest commits at: https://mentalnet.xyz/forgejo/markmental/tuxdock/actions --- ## ๐Ÿ–ฅ๏ธ Menu Overview ``` Tux-Dock: Docker Management Menu ---------------------------------- 1. Pull Docker Image 2. Run/Create Interactive Container 3. List All Containers 4. List All Images 5. Start Container Interactively (boot new session) 6. Start Detached Container Session 7. Delete Docker Image 8. Stop Container 9. Remove Container 10. Attach Shell to Running Container 11. Run Detached Command in Container 12. Spin Up MySQL Container 13. Get Container IP Address 14. Create Dockerfile & Build Image from Bash Script 15. Exit ``` Each action guides you through the required steps. For container-related commands, Tux-Dock automatically lists available containers and lets you choose by **number**, not by typing long IDs. --- ## ๐Ÿ“ก Example: Getting a Containerโ€™s IP Address ``` Available Containers: 1. mysql-container (ebaf5dbae393) 2. webapp (fa29b6c1f1e8) Select container to view IP (1-2): 2 Container IP Address: 172.17.0.3 ``` --- ## ๐Ÿงฑ Design Overview Tux-Dock is built using a single class: ```cpp class DockerManager { void pullImage(); void runContainerInteractive(); void listContainers() const; void startInteractive(); void execDetachedCommand(); void stopContainer(); void showContainerIP(); }; ``` This makes the codebase **extensible** โ€” adding new Docker features like `docker logs` or `docker stats` requires only a small new method. --- ## ๐Ÿง  Why C++? C++ was one of my formative languages when I was learning to program โ€” itโ€™s where I first grasped core concepts like memory management, data structures, OOP and abstraction. Writing Tux-Dock in C++ is both nostalgic and practical: it combines the clarity of modern design with the raw performance and control that first inspired me to code. --- ## ๐Ÿ“œ License MIT License โ€” free to use, modify, and share. --- ### ๐Ÿ’ก Tip If youโ€™d like Tux-Dock to run without `sudo`, add your user to the Docker group: ```bash sudo usermod -aG docker $USER ``` Then log out and back in. --- **Author:** MARKMENTAL **Project:** Tux-Dock โ€” *A clean and modern CLI for Docker power users.* ---