1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #34 from alexlarsson/dm-plugin-dummy-volumes

Use dummy driver for volumes
This commit is contained in:
Guillaume J. Charmes 2013-11-15 09:41:16 -08:00
commit 2b23da1d2f
2 changed files with 11 additions and 4 deletions

View file

@ -50,7 +50,7 @@ func Register(name string, initFunc InitFunc) error {
return nil
}
func getDriver(name, home string) (Driver, error) {
func GetDriver(name, home string) (Driver, error) {
if initFunc, exists := drivers[name]; exists {
return initFunc(path.Join(home, name))
}
@ -62,11 +62,11 @@ func New(root string) (Driver, error) {
var lastError error
// Use environment variable DOCKER_DRIVER to force a choice of driver
if name := os.Getenv("DOCKER_DRIVER"); name != "" {
return getDriver(name, root)
return GetDriver(name, root)
}
// Check for priority drivers first
for _, name := range priority {
driver, lastError = getDriver(name, root)
driver, lastError = GetDriver(name, root)
if lastError != nil {
utils.Debugf("Error loading driver %s: %s", name, lastError)
continue

View file

@ -628,7 +628,14 @@ func NewRuntimeFromDirectory(config *DaemonConfig) (*Runtime, error) {
if err != nil {
return nil, err
}
volumes, err := NewGraph(path.Join(config.Root, "volumes"), driver)
// We don't want to use a complex driver like aufs or devmapper
// for volumes, just a plain filesystem
volumesDriver, err := graphdriver.GetDriver("dummy", config.Root)
if err != nil {
return nil, err
}
volumes, err := NewGraph(path.Join(config.Root, "volumes"), volumesDriver)
if err != nil {
return nil, err
}