Skip to content

Commit

Permalink
fix(docker): stop container or kill if not going nice way
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed Nov 10, 2017
1 parent efd99d3 commit 925684d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/docker.ts
Expand Up @@ -180,7 +180,9 @@ export function killContainer(id: string): Promise<void> {
container = docker.getContainer(id);
container.inspect()
.then(containerInfo => {
if (containerInfo.State.Status === 'running') {
if (containerInfo.State.Status === 'exited') {
return container.remove();
} else if (containerInfo.State.Status === 'running') {
return container.kill().then(() => container.remove());
} else {
return Promise.resolve();
Expand Down

0 comments on commit 925684d

Please sign in to comment.