Merge pull request #36052 from Microsoft/jjh/no-overlay-off-only-one-disk

LCOW: Regular mount if only one layer
Upstream-commit: a8d0e36d0329063af9205b4848d1f5c09bd4c3be
Component: engine
This commit is contained in:
Sebastiaan van Stijn
2018-01-25 15:46:16 -08:00
committed by GitHub
@@ -299,7 +299,10 @@ func (svm *serviceVM) createUnionMount(mountName string, mvds ...hcsshim.MappedV
}
var cmd string
if mvds[0].ReadOnly {
if len(mvds) == 1 {
// `FROM SCRATCH` case and the only layer. No overlay required.
cmd = fmt.Sprintf("mount %s %s", mvds[0].ContainerPath, mountName)
} else if mvds[0].ReadOnly {
// Readonly overlay
cmd = fmt.Sprintf("mount -t overlay overlay -olowerdir=%s %s",
strings.Join(lowerLayers, ","),