How arelius-d/nexdocman works
Purpose and Entry Points
NeXdocMan is a Debian-oriented Bash utility that deploys, installs, manages, audits, updates, and removes Docker/Docker Compose environments. Its only visible implementation entry point is nexdocman.sh; the distributed release payload is NeXdocMan.tar.gz. Users invoke the script initially with --deploy, then use the globally installed nexdocman command interactively or through flags.
Paths: nexdocman.sh, NeXdocMan.tar.gz
Deployment and Persistent Footprint
The deploy stage initializes runtime directories, generates configuration, installs a persistent executable under /usr/local/bin/nexdocman, and removes the temporary downloaded payload. Runtime state is intentionally host-local rather than repository-managed: configuration is under /usr/local/lib/nexdocman/; logs are under /var/log/NeXdocMan/; schedules are written to the user/system crontab.
Paths: nexdocman.sh, README.md
Docker Installation Boundary
Installation is a privileged host-management flow: it detects Debian package conditions, removes conflicting legacy packages, installs Docker Engine and Compose using Docker’s official installation route, adds the active user to the docker group, and validates daemon operation with hello-world. It depends on OS package tooling, system services, Docker’s repository/install script, and either curl or wget.
Paths: nexdocman.sh, README.md
Interactive and Non-Interactive Control Plane
The script exposes an interactive terminal menu plus command flags for install, status, Docker/Compose maintenance, image checking/updating, cleanup, cron configuration, utility update, removal, and destructive purge. --yes supports unattended execution; verbosity controls terminal output. This is a CLI orchestration tool, not a daemon or web service.
Paths: nexdocman.sh, README.md
Image Update and Hot-Swap Flow
The update pipeline inspects local/running containers and their image references, checks/pulls updated images, and selectively recreates affected workloads. Compose-managed services use Compose recreation (up -d --no-deps); standalone containers are recreated through Docker-native operations. Configurable exclusions prevent matching container names, images, or glob patterns from being pulled or restarted. The key boundary is that NeXdocMan drives Docker/Compose but does not own application definitions or volumes.
Paths: nexdocman.sh, README.md
Scheduled Maintenance and Logging
Configuration controls independent cron schedules for deep Docker pruning and image updates. Cron launches the installed CLI, which runs briefly and exits, avoiding a persistent update daemon. Cleanup executes Docker system prune including volumes; operational and cron output are retained in separate log files, with optional age-based log pruning. Applying configuration is explicit through --configure-cron.
Paths: nexdocman.sh, README.md
Lifecycle, Self-Update, and Destructive Operations
Self-update polls GitHub’s API/releases and redeploys the global utility when a newer version exists. Removal deletes NeXdocMan binaries, configuration, logs, and cron entries while preserving Docker. Purge is a separate destructive boundary: it removes Docker/Compose and Docker/containerd data, including /var/lib/docker, /var/lib/containerd, and user Docker state.
Paths: nexdocman.sh, README.md
Main entry points: nexdocman.sh Menu and flags · NeXdocMan.tar.gz Release payload
Components 16
CLI control plane
- NeXdocMan script · Single implementation entry point.
nexdocman.sh - Deploy bootstrap · Initializes host-local installation.
nexdocman.sh - Global nexdocman · Persistent command at /usr/local/bin/nexdocman.
- Host configuration · Configuration under /usr/local/lib/nexdocman/.
- Menu and flags · Interactive menu and unattended flags including --yes.
nexdocman.sh
Docker management
- Docker install flow · Replaces legacy packages and installs Engine and Compose.
nexdocman.sh - Debian host tooling · Package tools, services, curl/wget, and Docker install route.
- Docker runtime · Daemon, images, containers, volumes, and Docker group.
- Image hot-swap · Pulls eligible images and selectively recreates workloads.
nexdocman.sh - Application workloads · Compose projects and standalone containers remain user-owned.
Scheduled maintenance
- Cron schedules · Independent cleanup and image-update schedules.
- Cleanup and logs · Prunes Docker including volumes and retains operational/cron logs.
nexdocman.sh
Lifecycle boundaries
- Release payload · Distributed deployment archive.
NeXdocMan.tar.gz - Self-update · Checks GitHub releases and redeploys newer utility versions.
nexdocman.sh - GitHub releases API
- Remove and purge · Removal preserves Docker; purge removes Docker and its data.
nexdocman.sh
Connections 23
- Release payload → Deploy bootstrap: initial --deploy
- NeXdocMan script → Deploy bootstrap: implements
- Deploy bootstrap → Global nexdocman: installs
- Deploy bootstrap → Host configuration: generates
- Global nexdocman → Menu and flags: invokes
- Menu and flags → Docker install flow: install commands
- Docker install flow → Debian host tooling: uses
- Docker install flow → Docker runtime: installs and validates
- Menu and flags → Image hot-swap: update commands
- Host configuration → Image hot-swap: exclusions
- Image hot-swap → Docker runtime: inspects, pulls, recreates
- Image hot-swap → Application workloads: Compose or native recreation
- Menu and flags → Cron schedules: --configure-cron
- Cron schedules → Global nexdocman: brief scheduled runs
- Global nexdocman → Cleanup and logs: cleanup execution
- Cleanup and logs → Docker runtime: system prune --volumes
- Host configuration → Cron schedules: schedule settings
- Menu and flags → Self-update: update command
- Self-update → GitHub releases API: checks releases
- Self-update → Deploy bootstrap: redeploys
- Menu and flags → Remove and purge: remove or purge
- Remove and purge → Global nexdocman: removes utility
- Remove and purge → Docker runtime: purge only · Deletes Docker, containerd, and data.