mirror of
https://github.com/opencontainers/runc.git
synced 2025-10-27 17:40:56 +08:00
This allows you to set certian configuration options such as what cgroup implementation to use on the factory at create time. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
28 lines
553 B
Go
28 lines
553 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"runtime"
|
|
|
|
"github.com/codegangsta/cli"
|
|
"github.com/docker/libcontainer"
|
|
_ "github.com/docker/libcontainer/nsenter"
|
|
)
|
|
|
|
var initCommand = cli.Command{
|
|
Name: "init",
|
|
Usage: "runs the init process inside the namespace",
|
|
Action: func(context *cli.Context) {
|
|
runtime.GOMAXPROCS(1)
|
|
runtime.LockOSThread()
|
|
factory, err := libcontainer.New("")
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if err := factory.StartInitialization(3); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
panic("This line should never been executed")
|
|
},
|
|
}
|