Created
January 21, 2017 14:11
-
-
Save teddyking/a27b0d59c11d4bbfe6596e8b042351df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func startContainer(context *cli.Context, spec *specs.Spec, create bool) (int, error) { | |
id := context.Args().First() | |
if id == "" { | |
return -1, errEmptyID | |
} | |
container, err := createContainer(context, id, spec) | |
if err != nil { | |
return -1, err | |
} | |
// Support on-demand socket activation by passing file descriptors into the container init process. | |
listenFDs := []*os.File{} | |
if os.Getenv("LISTEN_FDS") != "" { | |
listenFDs = activation.Files(false) | |
} | |
r := &runner{ | |
enableSubreaper: !context.Bool("no-subreaper"), | |
shouldDestroy: true, | |
container: container, | |
listenFDs: listenFDs, | |
consoleSocket: context.String("console-socket"), | |
detach: context.Bool("detach"), | |
pidFile: context.String("pid-file"), | |
create: create, | |
} | |
return r.run(&spec.Process) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment