Skip to content

Commit 925684d

Browse files
committed
fix(docker): stop container or kill if not going nice way
1 parent efd99d3 commit 925684d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/docker.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ export function killContainer(id: string): Promise<void> {
180180
container = docker.getContainer(id);
181181
container.inspect()
182182
.then(containerInfo => {
183-
if (containerInfo.State.Status === 'running') {
183+
if (containerInfo.State.Status === 'exited') {
184+
return container.remove();
185+
} else if (containerInfo.State.Status === 'running') {
184186
return container.kill().then(() => container.remove());
185187
} else {
186188
return Promise.resolve();

0 commit comments

Comments
 (0)