[ctr] Add --null-io to ctr run/start

This allows all task io to be redirected to /dev/null

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-10-18 11:12:18 -04:00
parent 992280e8e2
commit 2e004086cf
4 changed files with 20 additions and 4 deletions

View File

@@ -117,10 +117,13 @@ func newContainer(ctx gocontext.Context, client *containerd.Client, context *cli
)
}
func newTask(ctx gocontext.Context, client *containerd.Client, container containerd.Container, _ string, tty bool) (containerd.Task, error) {
func newTask(ctx gocontext.Context, client *containerd.Client, container containerd.Container, _ string, tty, nullIO bool) (containerd.Task, error) {
io := containerd.Stdio
if tty {
io = containerd.StdioTerminal
}
if nullIO {
io = containerd.NullIO
}
return container.NewTask(ctx, io)
}