diff --git a/runtime.go b/runtime.go index 21769789f5..220ca1af6c 100644 --- a/runtime.go +++ b/runtime.go @@ -283,6 +283,11 @@ func (runtime *Runtime) Destroy(container *Container) error { if err := os.RemoveAll(container.root); err != nil { return fmt.Errorf("Unable to remove filesystem for %v: %v", container.ID, err) } + if runtime.GetMountMethod() == MountMethodDeviceMapper { + if err := runtime.deviceSet.RemoveDevice(container.ID); err != nil { + return fmt.Errorf("Unable to remove device for %v: %v", container.ID, err) + } + } return nil }