Shortcut read-only bind-mounts in Windows, like non-Windows
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>v0.8
parent
11a8e7216a
commit
4e69b50469
|
@ -25,6 +25,19 @@ func (lm *localMounter) Mount() (string, error) {
|
||||||
return "", errors.Wrapf(errdefs.ErrNotImplemented, "request to mount %d layers, only 1 is supported", len(lm.mounts))
|
return "", errors.Wrapf(errdefs.ErrNotImplemented, "request to mount %d layers, only 1 is supported", len(lm.mounts))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if lm.mounts[0].Type == "bind" || lm.mounts[0].Type == "rbind" {
|
||||||
|
ro := false
|
||||||
|
for _, opt := range lm.mounts[0].Options {
|
||||||
|
if opt == "ro" {
|
||||||
|
ro = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !ro {
|
||||||
|
return lm.mounts[0].Source, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Windows mounts always activate in-place, so the target of the mount must be the source directory.
|
// Windows mounts always activate in-place, so the target of the mount must be the source directory.
|
||||||
// See https://github.com/containerd/containerd/pull/2366
|
// See https://github.com/containerd/containerd/pull/2366
|
||||||
dir := lm.mounts[0].Source
|
dir := lm.mounts[0].Source
|
||||||
|
|
Loading…
Reference in New Issue