mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 03:29:25 +01:00
fix(Docker): ensure containers fully removed on failed service install
This commit is contained in:
parent
a91c13867d
commit
bfc6c3d113
|
|
@ -608,8 +608,7 @@ export class DockerService {
|
|||
}
|
||||
|
||||
const dockerContainer = this.docker.getContainer(container.Id)
|
||||
await dockerContainer.stop()
|
||||
await dockerContainer.remove()
|
||||
await dockerContainer.remove({ force: true })
|
||||
|
||||
return { success: true, message: `Service ${serviceName} container removed successfully` }
|
||||
} catch (error) {
|
||||
|
|
@ -678,6 +677,10 @@ export class DockerService {
|
|||
await service.save()
|
||||
}
|
||||
this.activeInstallations.delete(serviceName)
|
||||
|
||||
// Ensure any partially created container is removed
|
||||
await this._removeServiceContainer(serviceName)
|
||||
|
||||
logger.info(`[DockerService] Cleaned up failed installation for ${serviceName}`)
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user