LCOW: Regular mount if only one layer

Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 420dc4eeb48b155e6b83fccf62f8727ce4bf5b21
Component: engine
This commit is contained in:
John Howard
2018-01-18 12:01:58 -08:00
parent ce1ad508f6
commit 942fd3c62c
@@ -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, ","),