diff --git a/client/driver/docker.go b/client/driver/docker.go index 8407d4675cc..9c9a29ab8ee 100644 --- a/client/driver/docker.go +++ b/client/driver/docker.go @@ -1015,7 +1015,7 @@ func (h *DockerHandle) run() { } // Remove the container - if err := h.client.RemoveContainer(docker.RemoveContainerOptions{ID: h.containerID, Force: true}); err != nil { + if err := h.client.RemoveContainer(docker.RemoveContainerOptions{ID: h.containerID, RemoveVolumes: true, Force: true}); err != nil { h.logger.Printf("[ERR] driver.docker: error removing container: %v", err) } diff --git a/client/driver/executor/checks_test.go b/client/driver/executor/checks_test.go index 62d7910b873..587797784a7 100644 --- a/client/driver/executor/checks_test.go +++ b/client/driver/executor/checks_test.go @@ -133,5 +133,5 @@ func TestDockerScriptCheck(t *testing.T) { // removeContainer kills and removes a container func removeContainer(client *docker.Client, containerID string) { client.KillContainer(docker.KillContainerOptions{ID: containerID}) - client.RemoveContainer(docker.RemoveContainerOptions{ID: containerID, Force: true}) + client.RemoveContainer(docker.RemoveContainerOptions{ID: containerID, RemoveVolumes: true, Force: true}) }