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 <tyaramer@gmail.com>
This commit is contained in:
Tyler Ramer 2019-10-15 10:03:43 -04:00
parent a9190dac36
commit 14e905e1eb
1 changed files with 3 additions and 1 deletions

View File

@ -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