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
@@ -612,8 +612,10 @@ func (r *LocalRuntime) Start(ctx context.Context, c *cliconfig.StartValues, sigP
if c.Attach {
inputStream := os.Stdin
if !c.Interactive {
+ if !ctr.Stdin() {
inputStream = nil
}
+ }
// attach to the container and also start it not already running
// If the container is in a pod, also set to recursively start dependencies
