mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
force docker image removal (#1985)
This commit is contained in:
@@ -2,7 +2,7 @@ use std::collections::HashMap;
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use bollard::image::ListImagesOptions;
|
use bollard::image::{ListImagesOptions, RemoveImageOptions};
|
||||||
use patch_db::{DbHandle, LockReceipt, LockTargetId, LockType, PatchDbHandle, Verifier};
|
use patch_db::{DbHandle, LockReceipt, LockTargetId, LockType, PatchDbHandle, Verifier};
|
||||||
use sqlx::{Executor, Postgres};
|
use sqlx::{Executor, Postgres};
|
||||||
use tracing::instrument;
|
use tracing::instrument;
|
||||||
@@ -132,7 +132,16 @@ pub async fn cleanup(ctx: &RpcContext, id: &PackageId, version: &Version) -> Res
|
|||||||
})
|
})
|
||||||
.map(|tag| async {
|
.map(|tag| async {
|
||||||
let tag = tag; // move into future
|
let tag = tag; // move into future
|
||||||
ctx.docker.remove_image(&tag, None, None).await
|
ctx.docker
|
||||||
|
.remove_image(
|
||||||
|
&tag,
|
||||||
|
Some(RemoveImageOptions {
|
||||||
|
force: true,
|
||||||
|
noprune: false,
|
||||||
|
}),
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
.await
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.await,
|
.await,
|
||||||
|
|||||||
Reference in New Issue
Block a user