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

Function createContainer

utils_linux.go:183–203  ·  view source on GitHub ↗
(context *cli.Context, id string, spec *specs.Spec)

Source from the content-addressed store, hash-verified

181}
182
183func 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
205type runner struct {
206 init bool

Callers 1

startContainerFunction · 0.85

Calls 3

CreateLibcontainerConfigFunction · 0.92
CreateFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…