(context *cli.Context, id string, spec *specs.Spec)
| 181 | } |
| 182 | |
| 183 | func createContainer(context *cli.Context, id string, spec *specs.Spec) (*libcontainer.Container, error) { |
| 184 | rootlessCg, err := shouldUseRootlessCgroupManager(context) |
| 185 | if err != nil { |
| 186 | return nil, err |
| 187 | } |
| 188 | config, err := specconv.CreateLibcontainerConfig(&specconv.CreateOpts{ |
| 189 | CgroupName: id, |
| 190 | UseSystemdCgroup: context.GlobalBool("systemd-cgroup"), |
| 191 | NoPivotRoot: context.Bool("no-pivot"), |
| 192 | NoNewKeyring: context.Bool("no-new-keyring"), |
| 193 | Spec: spec, |
| 194 | RootlessEUID: os.Geteuid() != 0, |
| 195 | RootlessCgroups: rootlessCg, |
| 196 | }) |
| 197 | if err != nil { |
| 198 | return nil, err |
| 199 | } |
| 200 | |
| 201 | root := context.GlobalString("root") |
| 202 | return libcontainer.Create(root, id, config) |
| 203 | } |
| 204 | |
| 205 | type runner struct { |
| 206 | init bool |
no test coverage detected
searching dependent graphs…