From 9bc5f3b5482d7e6d48868b7d22129e1814e482d5 Mon Sep 17 00:00:00 2001 From: Maxi <223365242+maximilianfeix@users.noreply.github.com> Date: Thu, 15 Oct 2026 07:36:55 +0200 Subject: [PATCH 1/2] feat: mark anonymous volumes Docker labels volumes it creates without a name with com.docker.volume.anonymous (moby daemon/volume/service/service.go). They are what docker rm without -v leaves behind. No new endpoint; the label is already in the system df volume list. --- CHANGELOG.md | 3 ++- README.md | 2 +- cmd/dockdu/testdata/json-keys.golden | 1 + internal/collect/compose_test.go | 12 ++++++++++++ internal/collect/volumes.go | 5 +++++ internal/report/model.go | 4 ++++ internal/report/text.go | 3 +++ internal/report/text_test.go | 12 ++++++++++++ 8 files changed, 40 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69b3772..45ca7e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ All notable changes to dockdu are listed here. The format follows [Keep a Change ## [Unreleased] -Nothing yet. +### Added +- Volumes Docker created without a name (an image `VOLUME` or `-v /path`, label `com.docker.volume.anonymous`) are marked `anonymous` in the volume list and in JSON (`volumes.items[].anonymous`). `docker rm` without `-v` leaves them behind. Verified on Engine 29.9. ## [0.4.0] - 2026-10-15 diff --git a/README.md b/README.md index 51b1f2e..6229d34 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ VOLUMES (2 · total 32.0 MiB · size unknown for 0) - **Logs per container.** Current file plus rotated siblings, the driver, whether rotation is bounded, and which compose service produced them. Measured with `stat` only; nothing is opened or read. - **Compose projects as the unit.** Containers, images, volumes and logs per project, orphans flagged, images used by several projects marked and counted once. Image sizes include base layers shared between different images; when that makes the columns add up to more than df's image row, dockdu says by how much. - **Images with "unique if removed".** Size minus shared layers, only when no container uses the image and the daemon computed both numbers. Otherwise `unknown`, never `0`. -- **Volumes with a state.** Referenced, unreferenced, or unknown. Orphan only when unreferenced *and* not created by compose. The hint is one `docker volume rm ` per orphan; dockdu never suggests `volume prune` or `--volumes`. +- **Volumes with a state.** Referenced, unreferenced, or unknown. Orphan only when unreferenced *and* not created by compose. Volumes Docker created without a name (left behind by `docker rm` without `-v`) are marked anonymous. The hint is one `docker volume rm ` per orphan; dockdu never suggests `volume prune` or `--volumes`. - **Warnings instead of guesses.** A log directory it cannot read, or a volume whose size the driver does not report, makes the total a lower bound, says so, and exits 2 so scripts notice. diff --git a/cmd/dockdu/testdata/json-keys.golden b/cmd/dockdu/testdata/json-keys.golden index c0d3c65..5f18e97 100644 --- a/cmd/dockdu/testdata/json-keys.golden +++ b/cmd/dockdu/testdata/json-keys.golden @@ -25,6 +25,7 @@ .daemon.storage_driver .filesystem .filesystem.available_bytes +.filesystem.classic_store_layers .filesystem.path .filesystem.size_bytes .filesystem.used_bytes diff --git a/internal/collect/compose_test.go b/internal/collect/compose_test.go index f3baff4..78f1d54 100644 --- a/internal/collect/compose_test.go +++ b/internal/collect/compose_test.go @@ -207,3 +207,15 @@ func TestProjectsReportImageLayerOverlap(t *testing.T) { t.Fatalf("without a df image total there is no overlap claim, got %d", got.ImageOverlapBytes) } } + +func TestVolumesMarkAnonymous(t *testing.T) { + s := &engine.Snapshot{Volumes: []engine.Volume{ + {Name: "3f1c0e9a8b7d6c5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e", HasUsageData: true, Size: 9, RefCount: 0, + Labels: map[string]string{"com.docker.volume.anonymous": ""}}, + {Name: "named", HasUsageData: true, Size: 1, RefCount: 0}, + }} + got, _ := Volumes(s) + if !got.Items[0].Anonymous || !got.Items[0].Orphan || got.Items[1].Anonymous { + t.Fatalf("anonymous flag: %+v", got.Items) + } +} diff --git a/internal/collect/volumes.go b/internal/collect/volumes.go index 91f4acd..b1147fb 100644 --- a/internal/collect/volumes.go +++ b/internal/collect/volumes.go @@ -7,6 +7,10 @@ import ( "github.com/maximilianfeix/dockdu/internal/report" ) +// anonymousVolumeLabel marks volumes Docker created without a name (moby +// daemon/volume/service/service.go AnonymousLabel). +const anonymousVolumeLabel = "com.docker.volume.anonymous" + // volumeReference classifies a volume as referenced, unreferenced or // unknown. A missing usage block or a RefCount of -1 is unknown, never // unreferenced: dockdu must not call something an orphan on a guess. @@ -37,6 +41,7 @@ func Volumes(s *engine.Snapshot) (report.Volumes, []string) { Bytes: -1, RefCount: v.RefCount, Reference: volumeReference(v), BuildxNode: buildxNode(v.Name), } + _, it.Anonymous = v.Labels[anonymousVolumeLabel] if v.HasUsageData && v.Size >= 0 { it.Bytes = v.Size out.TotalBytes += v.Size diff --git a/internal/report/model.go b/internal/report/model.go index ef6d615..b52f889 100644 --- a/internal/report/model.go +++ b/internal/report/model.go @@ -251,6 +251,10 @@ type VolumeItem struct { // BuildxNode is set when the volume is the state volume of a buildx // docker-container builder node: it holds that builder's build cache. BuildxNode string `json:"buildx_node,omitempty"` + // Anonymous is true for a volume Docker created without a name (an + // image VOLUME or `-v /path`), labelled com.docker.volume.anonymous. + // `docker rm` without -v leaves such volumes behind. + Anonymous bool `json:"anonymous"` } // Desktop is the macOS Docker Desktop / OrbStack section. diff --git a/internal/report/text.go b/internal/report/text.go index a70298f..0bc2724 100644 --- a/internal/report/text.go +++ b/internal/report/text.go @@ -301,6 +301,9 @@ func WriteText(w io.Writer, r *Report, top int) error { if it.Orphan { state = "orphan (unreferenced, not from compose)" } + if it.Anonymous { + state += ", anonymous" + } if it.BuildxNode != "" { state += ", buildx builder state (see BUILD CACHE)" } diff --git a/internal/report/text_test.go b/internal/report/text_test.go index 905ebee..fc3ed8c 100644 --- a/internal/report/text_test.go +++ b/internal/report/text_test.go @@ -432,3 +432,15 @@ func TestWriteTextClassicStoreHintWithoutDisk(t *testing.T) { t.Fatalf("hint missing:\n%s", buf.String()) } } + +func TestWriteTextMarksAnonymousVolumes(t *testing.T) { + r := goldenReport() + r.Volumes.Items = []VolumeItem{{Name: "3f1c0e9a8b7d", Driver: "local", Bytes: 9, Reference: "unreferenced", Orphan: true, Anonymous: true}} + var buf bytes.Buffer + if err := WriteText(&buf, r, 0); err != nil { + t.Fatal(err) + } + if !strings.Contains(flat(buf.String()), "orphan (unreferenced, not from compose), anonymous") { + t.Fatalf("anonymous not shown:\n%s", buf.String()) + } +} From f102c61e8eec25381f81c8a2f41a22e653138d8d Mon Sep 17 00:00:00 2001 From: Maxi <223365242+maximilianfeix@users.noreply.github.com> Date: Thu, 15 Oct 2026 07:37:18 +0200 Subject: [PATCH 2/2] docs: log v0.4.0, second article and X post --- PROGRESS.md | 14 ++++++++++++++ docs/growth/overnight-log.md | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/PROGRESS.md b/PROGRESS.md index 021a6ac..8cc5fcc 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -71,6 +71,13 @@ Remove containers and volumes by ID/name after checking the label; never prune. Full log: `docs/growth/overnight-log.md`. - **Scorecard:** token permissions and x/sys fixed (#32). BranchProtection should clear with the ruleset. CodeReview, Maintained and CII badge remain; they depend on the process and the project's age. +## State on 2026-10-15 (morning) + +- **v0.4.0 released and verified:** buildx docker-container builders (state volumes), `--disk` overlay2 by owner with a leftover finding (≥ 64 MiB and ≥ 10 %), classic store hidden by the containerd image store (also without `--disk`). Evidence: `docs/verification/buildx-overlay2-2026-10-15.md` (A–D). +- **Corrected:** README claimed containerd's compressed content is outside df; measured that df's Images row includes it (#44). +- **Unreleased on main:** anonymous volume marking (#45). +- **Published:** second dev.to article and one X post (links in `docs/growth/overnight-log.md`). + ## Next executable steps 1. Watch awesome-docker#1578 and cli-apps#509 and answer reviewers the same day. @@ -107,6 +114,13 @@ Full table and raw outputs: `docs/verification/v0.2-validation-2026-10-14.md`. E Found and fixed during validation: the IMAGES "reclaimable (as df counts it)" label was false on Engine 28 (edd226c). +## State on 2026-10-15 (morning) + +- **v0.4.0 released and verified:** buildx docker-container builders (state volumes), `--disk` overlay2 by owner with a leftover finding (≥ 64 MiB and ≥ 10 %), classic store hidden by the containerd image store (also without `--disk`). Evidence: `docs/verification/buildx-overlay2-2026-10-15.md` (A–D). +- **Corrected:** README claimed containerd's compressed content is outside df; measured that df's Images row includes it (#44). +- **Unreleased on main:** anonymous volume marking (#45). +- **Published:** second dev.to article and one X post (links in `docs/growth/overnight-log.md`). + ## Next executable steps (in order) 1. Owner: review the branch and approve a push plus PR. CI must pass on the PR: lint, build, test, integration and CodeQL. diff --git a/docs/growth/overnight-log.md b/docs/growth/overnight-log.md index 35f7baa..acad20b 100644 --- a/docs/growth/overnight-log.md +++ b/docs/growth/overnight-log.md @@ -29,6 +29,10 @@ Times are CEST. | ~22:08 | GitHub release | v0.3.3 (rootless hint, S3), curated notes, verified incl. on the rootless daemon | https://github.com/maximilianfeix/dockdu/releases/tag/v0.3.3 | published | — | | 22:13 | X (@44errrr) | One post: df 313.6 MiB vs 536.9 MiB of logs; prune printed 147.6MB and freed 72.7 MiB; links to the dev.to article and the repo | https://x.com/44errrr/status/2110463912328011969 | published | answer genuine replies; no repeat post | | 21:07 | X (@44errrr) | Two replies with the dockdu tagline under unrelated "founders" posts | — | **not from this session** (a parallel session); promotional replies in unrelated threads risk spam flags; stop them | maintainer decides | +| ~05:10 (10-15) | GitHub release | v0.4.0: buildx builder cache, overlay2 by owner, classic store hidden by the containerd store (#42, #43); verified (4/4 checksums, ghcr v0.4.0 amd64+arm64, cask, go install, brew) | https://github.com/maximilianfeix/dockdu/releases/tag/v0.4.0 | published, curated notes | — | +| ~05:30 (10-15) | dev.to | Second article "docker builder prune freed 0 B: two places Docker keeps disk space that no prune reaches", AI disclosure "Fully Autonomous" plus in-text disclosure | https://dev.to/taventix/docker-builder-prune-freed-0-b-two-places-docker-keeps-disk-space-that-no-prune-reaches-3lpb | published | watch comments | +| 07:34 (10-15) | X (@44errrr) | One post with the two new measurements and the article link (the earlier post had 65 views, 1 like, no replies) | https://x.com/44errrr/status/2110605324419805596 | published | answer genuine replies; no repeats | +| ~05:30 (10-15) | GitHub | Topics added: buildx, overlay2, containerd, docker-cleanup (19 of 20) | repo page | published | — | | — | Console.dev, newsletters | Email pitches | launch-kit/submissions.md | **drafted**: email is excluded by the maintainer's rules | maintainer sends | ## Measurements @@ -38,4 +42,6 @@ Times are CEST. | 2026-10-14 21:51 | 0 | 0 | 7 (1) | github.com 3 | 7 / 4 / 6 / 6 / 5 | | 2026-10-14 22:15 | see final check | | | | v0.3.3 added; downloads still dominated by the agent's own verification | +| 2026-10-15 07:40 | 1 | 0 | — | — | v0.4.0 added; external PRs #1578 and #509 still without review | + **Download caveat:** nearly all downloads so far are the agent's own post-release verifications (it fetches every archive once per release, plus one linux binary for the demo). They are not adoption.