diff --git a/daemon/delete.go b/daemon/delete.go index c109864644..98dd1bba0c 100644 --- a/daemon/delete.go +++ b/daemon/delete.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "path" + "runtime" "github.com/Sirupsen/logrus" ) @@ -112,9 +113,12 @@ func (daemon *Daemon) rm(container *Container, forceRemove bool) (err error) { return fmt.Errorf("Driver %s failed to remove root filesystem %s: %s", daemon.driver, container.ID, err) } - initID := fmt.Sprintf("%s-init", container.ID) - if err := daemon.driver.Remove(initID); err != nil { - return fmt.Errorf("Driver %s failed to remove init filesystem %s: %s", daemon.driver, initID, err) + // There will not be an -init on Windows, so don't fail by not attempting to delete it + if runtime.GOOS != "windows" { + initID := fmt.Sprintf("%s-init", container.ID) + if err := daemon.driver.Remove(initID); err != nil { + return fmt.Errorf("Driver %s failed to remove init filesystem %s: %s", daemon.driver, initID, err) + } } if err = os.RemoveAll(container.root); err != nil { diff --git a/daemon/graphdriver/driver_windows.go b/daemon/graphdriver/driver_windows.go index 3ba09781d4..5a825cb227 100644 --- a/daemon/graphdriver/driver_windows.go +++ b/daemon/graphdriver/driver_windows.go @@ -1,26 +1,25 @@ package graphdriver +import ( + _ "github.com/docker/docker/daemon/graphdriver/vfs" + + // TODO Windows - Add references to real graph driver when PR'd +) + type DiffDiskDriver interface { Driver CopyDiff(id, sourceId string) error } -const ( - FsMagicWindows = FsMagic(0xa1b1830f) -) - var ( - // Slice of drivers that should be used in an order + // Slice of drivers that should be used in order priority = []string{ "windows", - } - - FsNames = map[FsMagic]string{ - FsMagicWindows: "windows", - FsMagicUnsupported: "unsupported", + "vfs", } ) func GetFSMagic(rootpath string) (FsMagic, error) { - return FsMagicWindows, nil + // Note it is OK to return FsMagicUnsupported on Windows. + return FsMagicUnsupported, nil } diff --git a/daemon/graphdriver/vfs/driver.go b/daemon/graphdriver/vfs/driver.go index 521e822826..63c93ac30d 100644 --- a/daemon/graphdriver/vfs/driver.go +++ b/daemon/graphdriver/vfs/driver.go @@ -5,7 +5,7 @@ package vfs import ( "fmt" "os" - "path" + "path/filepath" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/pkg/chrootarchive" @@ -42,7 +42,7 @@ func (d *Driver) Cleanup() error { func (d *Driver) Create(id, parent string) error { dir := d.dir(id) - if err := system.MkdirAll(path.Dir(dir), 0700); err != nil { + if err := system.MkdirAll(filepath.Dir(dir), 0700); err != nil { return err } if err := os.Mkdir(dir, 0755); err != nil { @@ -66,7 +66,7 @@ func (d *Driver) Create(id, parent string) error { } func (d *Driver) dir(id string) string { - return path.Join(d.home, "dir", path.Base(id)) + return filepath.Join(d.home, "dir", filepath.Base(id)) } func (d *Driver) Remove(id string) error {