mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
forcefully remove the container, blowing past 409s
This commit is contained in:
@@ -5,6 +5,7 @@ use std::net::Ipv4Addr;
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
|
use bollard::container::RemoveContainerOptions;
|
||||||
use futures::future::Either as EitherFuture;
|
use futures::future::Either as EitherFuture;
|
||||||
use nix::sys::signal;
|
use nix::sys::signal;
|
||||||
use nix::unistd::Pid;
|
use nix::unistd::Pid;
|
||||||
@@ -68,7 +69,18 @@ impl DockerAction {
|
|||||||
.arg(&container_name)
|
.arg(&container_name)
|
||||||
.arg(format!("--hostname={}", &container_name))
|
.arg(format!("--hostname={}", &container_name))
|
||||||
.arg("--no-healthcheck");
|
.arg("--no-healthcheck");
|
||||||
match ctx.docker.remove_container(&container_name, None).await {
|
match ctx
|
||||||
|
.docker
|
||||||
|
.remove_container(
|
||||||
|
&container_name,
|
||||||
|
Some(RemoveContainerOptions {
|
||||||
|
v: false,
|
||||||
|
force: true,
|
||||||
|
link: false,
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
{
|
||||||
Ok(()) | Err(bollard::errors::Error::DockerResponseNotFoundError { .. }) => Ok(()),
|
Ok(()) | Err(bollard::errors::Error::DockerResponseNotFoundError { .. }) => Ok(()),
|
||||||
Err(e) => Err(e),
|
Err(e) => Err(e),
|
||||||
}?;
|
}?;
|
||||||
|
|||||||
Reference in New Issue
Block a user