Add --console to specify path to use from runc

This flag allows systems that are running runc to allocate tty's that
they own and provide to the container.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2016-01-07 14:34:11 -08:00
parent 5c46b9d438
commit 4c4c9b85b7
4 changed files with 29 additions and 9 deletions
+10 -4
View File
@@ -26,6 +26,11 @@ var startCommand = cli.Command{
Value: "",
Usage: "path to the root of the bundle directory",
},
cli.StringFlag{
Name: "console",
Value: "",
Usage: "specify the pty slave path for use with the container",
},
},
Action: func(context *cli.Context) {
bundle := context.String("bundle")
@@ -44,9 +49,10 @@ var startCommand = cli.Command{
setupSdNotify(spec, rspec, notifySocket)
}
listenFds := os.Getenv("LISTEN_FDS")
listenPid := os.Getenv("LISTEN_PID")
var (
listenFds = os.Getenv("LISTEN_FDS")
listenPid = os.Getenv("LISTEN_PID")
)
if listenFds != "" && listenPid == strconv.Itoa(os.Getpid()) {
setupSocketActivation(spec, listenFds)
}
@@ -114,7 +120,7 @@ func startContainer(context *cli.Context, spec *specs.LinuxSpec, rspec *specs.Li
process.ExtraFiles = append(process.ExtraFiles, os.NewFile(uintptr(i), ""))
}
}
tty, err := newTty(spec.Process.Terminal, process, rootuid)
tty, err := newTty(spec.Process.Terminal, process, rootuid, context.String("console"))
if err != nil {
return -1, err
}