Replies: 1 comment 3 replies
-
|
Technically you can achieve the same thing today by running something like: runc list -q | xargs -n1 runc deleteor for ct in $(runc list -q); do runc delete $ct; doneIn both cases, all the running containers are skipped with a warning (unless Note that crun delete -r .(where Maybe we should implement it, too. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Current situation
Currently, runc delete can only remove a single container by its ID. In high-volume environments or batch container management scenarios, cleaning up stopped containers manually or one by one is cumbersome. This can also exacerbate resource contention, e.g., DBus delays or cgroup lock contention (see runc#4853).
Use case / Scenario
Direct usage of runc for batch container management.
Environments with high container churn.
Need to quickly reclaim resources from stopped containers without affecting running ones.
Proposed solution
Introduce a new flag to runc delete, e.g.:
Behavior:
Deletes all stopped containers.
Skips running containers.
Cleans up metadata and cgroups of stopped containers.
Reuses the existing internal delete logic for consistency.
Benefits
Simplifies batch cleanup of stopped containers.
Avoids manual scripting to delete multiple containers.
Keeps CLI semantics consistent with single-container deletion.
Questions / Discussion Points
Are there edge cases where deleting stopped containers could interfere with ongoing operations?
Should the command output a summary of deleted containers?
Beta Was this translation helpful? Give feedback.
All reactions