mirror of https://github.com/docker/docs.git
Create zfs directory if it doesn't exist at startup.
Signed-off-by: Damian Smyth <damian@dsau.co> (cherry picked from commit 205bc6fc99872ba852fa7a158c106514d5b64179) Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
parent
47a16dbe31
commit
f370132a42
|
|
@ -99,6 +99,14 @@ func Init(base string, opt []string, uidMaps, gidMaps []idtools.IDMap) (graphdri
|
||||||
return nil, fmt.Errorf("BUG: zfs get all -t filesystem -rHp '%s' should contain '%s'", options.fsName, options.fsName)
|
return nil, fmt.Errorf("BUG: zfs get all -t filesystem -rHp '%s' should contain '%s'", options.fsName, options.fsName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rootUID, rootGID, err := idtools.GetRootUIDGID(uidMaps, gidMaps)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("Failed to get root uid/guid: %v", err)
|
||||||
|
}
|
||||||
|
if err := idtools.MkdirAllAs(base, 0700, rootUID, rootGID); err != nil {
|
||||||
|
return nil, fmt.Errorf("Failed to create '%s': %v", base, err)
|
||||||
|
}
|
||||||
|
|
||||||
if err := mount.MakePrivate(base); err != nil {
|
if err := mount.MakePrivate(base); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue