summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorTyler Ramer <tyaramer@gmail.com>2019-10-15 10:03:43 -0400
committerTyler Ramer <tyaramer@gmail.com>2019-10-15 16:05:14 -0400
commit14e905e1eb27918322b7b62e0ca38045456d384c (patch)
tree686949c9f3b403b9cacee86884d15ef21a7b00c6 /pkg
parenta9190dac36f3f220ddc65ad8295778d40566e61f (diff)
downloadpodman-14e905e1eb27918322b7b62e0ca38045456d384c.tar.gz
podman-14e905e1eb27918322b7b62e0ca38045456d384c.tar.bz2
podman-14e905e1eb27918322b7b62e0ca38045456d384c.zip
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>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/adapter/containers.go4
1 files changed, 3 insertions, 1 deletions
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