Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 14 additions & 0 deletions PROGRESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <name>` 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 <name>` 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.

<a id="docker-desktop"></a>
Expand Down
1 change: 1 addition & 0 deletions cmd/dockdu/testdata/json-keys.golden
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
.daemon.storage_driver
.filesystem
.filesystem.available_bytes
.filesystem.classic_store_layers
.filesystem.path
.filesystem.size_bytes
.filesystem.used_bytes
Expand Down
6 changes: 6 additions & 0 deletions docs/growth/overnight-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
12 changes: 12 additions & 0 deletions internal/collect/compose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
5 changes: 5 additions & 0 deletions internal/collect/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions internal/report/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions internal/report/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
}
Expand Down
12 changes: 12 additions & 0 deletions internal/report/text_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
Loading