Skip to content

fix: remove anonymous volumes on down and limit gc to them - #2

Merged
hkyss merged 1 commit into
devfrom
fix/anonymous-volume-leak
Nov 4, 2026
Merged

hkyss merged 1 commit into
devfrom
fix/anonymous-volume-leak

Conversation

@hkyss

@hkyss hkyss commented Nov 4, 2026

Copy link
Copy Markdown
Owner

devctl down left every anonymous volume of the project behind (node_modules, MySQL and Manticore data), so a new one piled up on every down/up cycle. On one machine that was ~60 volumes, ~15 GB.

  • down collects the project's anonymous volumes (including stopped containers) before docker compose down and removes them only if the down succeeded. Named volumes are left alone.
  • gc and the doctor warning now filter on label=com.docker.volume.anonymous. Before, dangling=true alone also listed named volumes with no container, i.e. real databases.

Tests: 368 OK, ruff check and format clean.

@hkyss hkyss closed this Nov 4, 2026
@hkyss hkyss reopened this Nov 4, 2026
@hkyss
hkyss merged commit bc8f60a into dev Nov 4, 2026
4 checks passed
@hkyss
hkyss deleted the fix/anonymous-volume-leak branch November 4, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant