Skip to content

Commit

Permalink
Merge pull request #1519 from vrenjith/master
Browse files Browse the repository at this point in the history
Remove docker volumes while removing container
  • Loading branch information
dadgar committed Aug 4, 2016
2 parents d4a4700 + 52c6201 commit ed08b5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/driver/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,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)
}

Expand Down
2 changes: 1 addition & 1 deletion client/driver/executor/checks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
}

0 comments on commit ed08b5f

Please sign in to comment.