Skip to content

fix(docker): never prune other projects' containers or images - #19

Merged
matbrgz merged 1 commit into
masterfrom
fix/scoped-docker-cleanup
Oct 6, 2026
Merged

matbrgz merged 1 commit into
masterfrom
fix/scoped-docker-cleanup

Conversation

@matbrgz

@matbrgz matbrgz commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

DockerHelper.stop() ran containers.prune() and clean() ran images.prune() twice, all machine-wide. On a shared Docker host that removes other projects' stopped containers and dangling images (found while running many generator builds next to another project on the same Docker Desktop).

  • stop() prunes only containers labelled ssgberk.run=<run_id> (the label every toolset container already carries, BT 004).
  • clean() removes only ssgberk/test.* images and no longer prunes dangling images; removing a tagged image already deletes its unused layers.

Test

  • New tests: prune is called with the run-label filter; clean() removes only the ssgberk test image and never calls images.prune.
  • Full suite and ruff pass.

🤖 Generated with Claude Code

stop() pruned every stopped container on the Docker host and clean()
pruned every dangling image. On a shared host that deletes other
projects' containers. stop() now prunes only containers labelled
ssgberk.run=<run_id>; clean() removes only ssgberk/test.* images.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@matbrgz
matbrgz force-pushed the fix/scoped-docker-cleanup branch from 4864ee2 to 54be401 Compare October 6, 2026 11:04
@matbrgz
matbrgz merged commit 54be401 into master Oct 6, 2026
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