mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 09:04:12 +02:00
cleanup service containers if php container fails to start
This commit is contained in:
parent
36fcc3aa9e
commit
a658a03043
1 changed files with 20 additions and 2 deletions
22
src/cloud.rs
22
src/cloud.rs
|
|
@ -304,11 +304,29 @@ impl Cloud {
|
|||
.map(String::from),
|
||||
);
|
||||
|
||||
let container = options
|
||||
let container = match options
|
||||
.php
|
||||
.spawn(docker, &id, env, &options.db, &network, volumes, gateway)
|
||||
.await
|
||||
.wrap_err("Failed to start php container")?;
|
||||
.wrap_err("Failed to start php container")
|
||||
{
|
||||
Ok(container) => container,
|
||||
Err(e) => {
|
||||
for container in service_containers {
|
||||
docker
|
||||
.remove_container(
|
||||
&container,
|
||||
Some(RemoveContainerOptions {
|
||||
force: true,
|
||||
..RemoveContainerOptions::default()
|
||||
}),
|
||||
)
|
||||
.await
|
||||
.ok();
|
||||
}
|
||||
return Err(e);
|
||||
}
|
||||
};
|
||||
|
||||
let mut tries = 0;
|
||||
let ip = loop {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue