Merge pull request #520 from rhatdan/slave
Change mount point propogation to default to slave
This commit is contained in:
commit
883cbf7d28
|
@ -37,6 +37,9 @@ type Config struct {
|
|||
// bind mounts are writtable.
|
||||
Readonlyfs bool `json:"readonlyfs"`
|
||||
|
||||
// Privatefs will mount the container's rootfs as private where mount points from the parent will not propogate
|
||||
Privatefs bool `json:"privatefs"`
|
||||
|
||||
// Mounts specify additional source and destination paths that will be mounted inside the container's
|
||||
// rootfs and mount namespace if specified
|
||||
Mounts []*Mount `json:"mounts"`
|
||||
|
|
|
@ -248,9 +248,9 @@ func mknodDevice(dest string, node *configs.Device) error {
|
|||
}
|
||||
|
||||
func prepareRoot(config *configs.Config) error {
|
||||
flag := syscall.MS_PRIVATE | syscall.MS_REC
|
||||
if config.NoPivotRoot {
|
||||
flag = syscall.MS_SLAVE | syscall.MS_REC
|
||||
flag := syscall.MS_SLAVE | syscall.MS_REC
|
||||
if config.Privatefs {
|
||||
flag = syscall.MS_PRIVATE | syscall.MS_REC
|
||||
}
|
||||
if err := syscall.Mount("", "/", "", uintptr(flag), ""); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue