Personal project · Desktop application

dockmaster

Manage Docker on Linux, with an honest account of what is unused

  • Python 3
  • GTK 4
  • libadwaita
  • PyGObject
  • Docker CLI
  • pkexec
  • unittest

A desktop application for managing Docker on Linux: containers, images, volumes, networks, build cache and compose projects — with an honest account of what is unused and what removing it would actually free.

It exists because the interesting questions are tedious from the CLI. On the machine it was written for, Docker held about 60 GB that could be reclaimed, and finding out which 60 GB — and which of it was safe to delete — took a lot of docker inspect.

Looking never changes anything. Every change, from a single Stop to a 35 GB prune, becomes a bash script you can read in full before it runs; the preview is the script that executes, so the two cannot drift apart.

What it does

Inspect

  • Containers grouped by compose project, with state, health, ports, mounts and exit codes
  • Images with what removing each would actually free, since images share layers
  • Volumes with their real sizes, networks, and the build cache summarised by type and age instead of hundreds of rows
  • A terminal report and JSON inventory for scripts — both work with no display at all

Reach into containers and volumes

  • Browse a volume by mounting it read-only into a throwaway alpine container — no password, even though /var/lib/docker is root-only
  • Export a volume as a tar streamed through stdout, so the file lands owned by you rather than root
  • Attach opens docker exec in your terminal, resolving the shell inside the container first, so a distroless image says it has no shell instead of failing cryptically
  • docker attach is deliberately not offered: it shares PID 1’s stdin, and Ctrl-C would kill the container

Change things

  • Start, stop, restart, pause, kill and remove containers; remove images, volumes and networks
  • compose up -d, down and restart per project
  • Granular prunes only — docker system prune is not offered, because it sweeps four resource classes at once with no way to show what it is about to delete
  • Removing a volume is never treated as safe: it is the only thing Docker holds that cannot be rebuilt, so you type its name to confirm

Numbers you can check

  • Figures come from docker system df where the daemon provides them, so the CLI shows the same number
  • Build cache reclaimable counts only records that are unused and not shared — 35.3 GB, not the naive 40.7 GB
  • Image sizes are never summed, because shared layers would double count them
  • Dangling and unused images are separate actions with separate totals
  • A size that is not known is shown as —, never as 0

How safety is enforced

  • Every command issued while inspecting is validated argument by argument against a read-only allowlist
  • No shell: every command is an argv list, and resource names are validated against a charset before they can become an argument
  • Every targeted removal carries a precheck embedded in the script, so it refuses to remove a container that has started or a volume that has come into use
  • Each script is written mode 0600, hashed with SHA-256 and logged
  • The application refuses to run as root

Download

Source archive

Linux

Pure Python, nothing to build. Includes the installer and the test suite.

Download

Requirements

  • Linux with GTK 4 and libadwaita — built on Pop!_OS 22.04
  • python3-gi, gir1.2-gtk-4.0 and gir1.2-adw-1 — nothing from PyPI, no pip, no virtualenv
  • Docker, with your user in the docker group (which is root-equivalent — anyone who can reach the socket can mount the whole filesystem)
  • The terminal and JSON modes need neither GTK nor Docker; --demo runs on sample data

Installing

This user

tar -xzf dockmaster-source.tar.gz
cd docker_master
./install.sh

Copies the application to ~/.local/lib/dockmaster, puts dockmaster on PATH and registers a menu entry and icon, so it can be pinned to the dock. No root needed.

Everyone

sudo ./install.sh --system

The same layout under /usr/local. ./install.sh --uninstall removes only what the installer put there.

Without installing

./bin/dockmaster --demo   # GUI on sample data
./bin/dockmaster --text   # terminal report

The launcher finds a Python interpreter that can import GTK on its own.

Source code

The source is not hosted publicly. The archive above is the complete project; if you have questions about the code, get in touch.