From 14e905e1eb27918322b7b62e0ca38045456d384c Mon Sep 17 00:00:00 2001 From: Tyler Ramer Date: Tue, 15 Oct 2019 10:03:43 -0400 Subject: 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(-) (limited to 'pkg') diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go index e67cc03ba..03ccc3918 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 -- cgit v1.2.3-54-g00ecf