diff --git a/drivers/docker/driver.go b/drivers/docker/driver.go index bb94d3435..d11acc422 100644 --- a/drivers/docker/driver.go +++ b/drivers/docker/driver.go @@ -1019,6 +1019,7 @@ func (d *Driver) DestroyTask(taskID string, force bool) error { } defer h.dloggerPluginClient.Kill() + if err := h.client.StopContainer(h.containerID, 0); err != nil { h.logger.Warn("failed to stop container during destroy", "error", err) } @@ -1033,6 +1034,7 @@ func (d *Driver) DestroyTask(taskID string, force bool) error { "error", err) } + d.tasks.Delete(taskID) return nil }