Removing in specific scenarios.

This commit is contained in:
mike12345567 2024-12-16 18:29:15 +00:00
parent fe5f76f27d
commit 08f4e0d9ae
1 changed files with 5 additions and 2 deletions

View File

@ -160,8 +160,11 @@ export async function startContainer(container: GenericContainer) {
// matching container and it has exited, we remove it before carrying on. This // matching container and it has exited, we remove it before carrying on. This
// removes the need to do this removal manually. // removes the need to do this removal manually.
const existingContainer = getContainerByName(name) const existingContainer = getContainerByName(name)
if (existingContainer && existingContainer.State !== "running") { if (
console.log("--- REMOVING EXISTING CONTAINER --- ") existingContainer?.State === "exited" ||
existingContainer?.State === "dead" ||
existingContainer?.State === "paused"
) {
removeContainer(existingContainer) removeContainer(existingContainer)
} }