From 14e905e1eb27918322b7b62e0ca38045456d384c Mon Sep 17 00:00:00 2001 From: Tyler Ramer Date: Tue, 15 Oct 2019 10:03:43 -0400 Subject: [PATCH] Attach stdin to container at start if it was created with --interactive Check to see if the container's start config includes the interactive flag when determining to attach or ignore stdin stream. This is in line with behavior of Docker CLI and engine Signed-off-by: Tyler Ramer --- pkg/adapter/containers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go index e67cc03baf..03ccc3918e 100644 --- a/pkg/adapter/containers.go +++ b/pkg/adapter/containers.go @@ -612,7 +612,9 @@ func (r *LocalRuntime) Start(ctx context.Context, c *cliconfig.StartValues, sigP if c.Attach { inputStream := os.Stdin if !c.Interactive { - inputStream = nil + if !ctr.Stdin() { + inputStream = nil + } } // attach to the container and also start it not already running