Clean up after unexpectedly terminated build

The `podman system prune` command is able to remove build containers that were created during the build, but were not removed because the build terminated unexpectedly.

By default, build containers are not removed to prevent interference with builds in progress. Use the **--build** flag when running the command to remove build containers as well.

Fixes: https://issues.redhat.com/browse/RHEL-62009

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
This commit is contained in:
Jan Rodák committed 2025-01-27 14:21:27 +01:00
1 parent 3b6c7665b9
commit 81eb84fdaa
10 files changed
+158 -11

No files matched your search

+2
View File
@@ -25,6 +25,7 @@ func SystemPrune(w http.ResponseWriter, r *http.Request) {
All bool `schema:"all"`
Volumes bool `schema:"volumes"`
External bool `schema:"external"`
Build bool `schema:"build"`
}{}
if err := decoder.Decode(&query, r.URL.Query()); err != nil {
@@ -46,6 +47,7 @@ func SystemPrune(w http.ResponseWriter, r *http.Request) {
Volume: query.Volumes,
Filters: *filterMap,
External: query.External,
Build: query.Build,
}
report, err := containerEngine.SystemPrune(r.Context(), pruneOptions)
if err != nil {