mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Windows: Allow VFS
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
5821f13b8c
commit
e89f837bc6
3 changed files with 20 additions and 17 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue