Merge pull request #5717 from philips/mkdir-in-daemon
fix(daemon): ensure the /var/lib/docker dir exists
This commit is contained in:
commit
bc77ec2b17
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue