mirror of
https://github.com/opencontainers/runc.git
synced 2025-09-27 03:46:19 +08:00
Add --no-pivot option for containers on ramdisk
This adds a `--no-pivot` cli flag to runc so that a container's rootfs can be located ontop of ramdisk/tmpfs and not fail because you cannot pivot root. This should be a cli flag and not part of the spec because this is a detail of the host/runtime environment and not an attribute of a container. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
7
utils.go
7
utils.go
@@ -175,7 +175,12 @@ func createPidFile(path string, process *libcontainer.Process) error {
|
||||
}
|
||||
|
||||
func createContainer(context *cli.Context, id string, spec *specs.Spec) (libcontainer.Container, error) {
|
||||
config, err := specconv.CreateLibcontainerConfig(id, context.GlobalBool("systemd-cgroup"), spec)
|
||||
config, err := specconv.CreateLibcontainerConfig(&specconv.CreateOpts{
|
||||
CgroupName: id,
|
||||
UseSystemdCgroup: context.GlobalBool("systemd-cgroup"),
|
||||
NoPivotRoot: context.Bool("no-pivot"),
|
||||
Spec: spec,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user