Merge pull request #5717 from philips/mkdir-in-daemon

fix(daemon): ensure the /var/lib/docker dir exists
This commit is contained in:
Guillaume J. Charmes 2014-05-12 14:13:56 -07:00
commit bc77ec2b17

View file

@ -680,6 +680,12 @@ func NewDaemonFromDirectory(config *daemonconfig.Config, eng *engine.Engine) (*D
if !config.EnableSelinuxSupport {
selinux.SetDisabled()
}
// Create the root directory if it doesn't exists
if err := os.MkdirAll(config.Root, 0700); err != nil && !os.IsExist(err) {
return nil, err
}
// Set the default driver
graphdriver.DefaultDriver = config.GraphDriver