Skip to content

Commit

Permalink
Attach stdin to container at start if it was created with --interactive
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tylarb committed Oct 15, 2019
1 parent a9190da commit 14e905e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/adapter/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 14e905e

Please sign in to comment.