From 2168e591ab34dbf2f229b6718cbb70a3f2400daa Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 6 Jul 2015 15:24:23 -0700 Subject: [PATCH] Always attach STDIN if -i,--interactive is specified There is no reason to error out or not do what the user expects when -i is specified on the cli. We should always attach to the stdin of the container in this situation. Closes #14390 Signed-off-by: Michael Crosby Upstream-commit: 691b2851f7b745d225a2698b964cf60f55a0c4d7 Component: engine --- components/engine/runconfig/parse.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/engine/runconfig/parse.go b/components/engine/runconfig/parse.go index d512bd3078..e50018bbe6 100644 --- a/components/engine/runconfig/parse.go +++ b/components/engine/runconfig/parse.go @@ -156,14 +156,13 @@ func Parse(cmd *flag.FlagSet, args []string) (*Config, *HostConfig, *flag.FlagSe return nil, nil, cmd, fmt.Errorf("%s is not a valid mac address", *flMacAddress) } } - - // If neither -d or -a are set, attach to everything by default + if *flStdin { + attachStdin = true + } + // If -a is not set attach to the output stdio if flAttach.Len() == 0 { attachStdout = true attachStderr = true - if *flStdin { - attachStdin = true - } } var flMemory int64