mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #33281 from dmcgowan/overlay2-on-btrfs
Support overlay2 on btrfs
This commit is contained in:
commit
01af41ed99
1 changed files with 11 additions and 1 deletions
|
@ -150,9 +150,19 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap
|
|||
|
||||
// check if they are running over btrfs, aufs, zfs, overlay, or ecryptfs
|
||||
switch fsMagic {
|
||||
case graphdriver.FsMagicBtrfs, graphdriver.FsMagicAufs, graphdriver.FsMagicZfs, graphdriver.FsMagicOverlay, graphdriver.FsMagicEcryptfs:
|
||||
case graphdriver.FsMagicAufs, graphdriver.FsMagicZfs, graphdriver.FsMagicOverlay, graphdriver.FsMagicEcryptfs:
|
||||
logrus.Errorf("'overlay2' is not supported over %s", backingFs)
|
||||
return nil, graphdriver.ErrIncompatibleFS
|
||||
case graphdriver.FsMagicBtrfs:
|
||||
// Support for OverlayFS on BTRFS was added in kernel 4.7
|
||||
// See https://btrfs.wiki.kernel.org/index.php/Changelog
|
||||
if kernel.CompareKernelVersion(*v, kernel.VersionInfo{Kernel: 4, Major: 7, Minor: 0}) < 0 {
|
||||
if !opts.overrideKernelCheck {
|
||||
logrus.Errorf("'overlay2' requires kernel 4.7 to use on %s", backingFs)
|
||||
return nil, graphdriver.ErrIncompatibleFS
|
||||
}
|
||||
logrus.Warn("Using pre-4.7.0 kernel for overlay2 on btrfs, may require kernel update")
|
||||
}
|
||||
}
|
||||
|
||||
rootUID, rootGID, err := idtools.GetRootUIDGID(uidMaps, gidMaps)
|
||||
|
|
Loading…
Reference in a new issue