Merge pull request #890 from avagin/emptyns

restore: add the empty-ns option
This commit is contained in:
Daniel, Dao Quang Minh 2016-06-07 18:47:32 +01:00
commit fd7d128191
1 changed files with 8 additions and 0 deletions

View File

@ -77,6 +77,10 @@ using the runc checkpoint command.`,
Name: "no-pivot",
Usage: "do not use pivot root to jail process inside rootfs. This should be used whenever the rootfs is on top of a ramdisk",
},
cli.StringSliceFlag{
Name: "empty-ns",
Usage: "create a namespace, but don't restore its properies",
},
},
Action: func(context *cli.Context) error {
imagePath := context.String("image-path")
@ -143,6 +147,10 @@ func restoreContainer(context *cli.Context, spec *specs.Spec, config *configs.Co
setManageCgroupsMode(context, options)
if err := setEmptyNsMask(context, options); err != nil {
return -1, err
}
// ensure that the container is always removed if we were the process
// that created it.
detach := context.Bool("detach")