github.com/wozhu6104/docker@v20.10.10+incompatible/volume/service/default_driver.go (about)

     1  // +build linux windows
     2  
     3  package service // import "github.com/docker/docker/volume/service"
     4  import (
     5  	"github.com/docker/docker/pkg/idtools"
     6  	"github.com/docker/docker/volume"
     7  	"github.com/docker/docker/volume/drivers"
     8  	"github.com/docker/docker/volume/local"
     9  	"github.com/pkg/errors"
    10  )
    11  
    12  func setupDefaultDriver(store *drivers.Store, root string, rootIDs idtools.Identity) error {
    13  	d, err := local.New(root, rootIDs)
    14  	if err != nil {
    15  		return errors.Wrap(err, "error setting up default driver")
    16  	}
    17  	if !store.Register(d, volume.DefaultDriverName) {
    18  		return errors.New("local volume driver could not be registered")
    19  	}
    20  	return nil
    21  }