MCPcopy
hub / github.com/opencontainers/runc / prepareRoot

Function prepareRoot

libcontainer/rootfs_linux.go:1098–1112  ·  view source on GitHub ↗
(config *configs.Config)

Source from the content-addressed store, hash-verified

1096}
1097
1098func prepareRoot(config *configs.Config) error {
1099 flag := unix.MS_SLAVE | unix.MS_REC
1100 if config.RootPropagation != 0 {
1101 flag = config.RootPropagation
1102 }
1103 if err := mount("", "/", "", uintptr(flag), ""); err != nil {
1104 return err
1105 }
1106
1107 if err := rootfsParentMountPrivate(config.Rootfs); err != nil {
1108 return err
1109 }
1110
1111 return mount(config.Rootfs, config.Rootfs, "bind", unix.MS_BIND|unix.MS_REC, "")
1112}
1113
1114func setReadonly() error {
1115 flags := uintptr(unix.MS_BIND | unix.MS_REMOUNT | unix.MS_RDONLY)

Callers 1

prepareRootfsFunction · 0.85

Calls 2

mountFunction · 0.85
rootfsParentMountPrivateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…