mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Activate Config.StdinOnce at argument parsing
This commit is contained in:
parent
8f9e454241
commit
aea2675f7b
2 changed files with 4 additions and 1 deletions
|
@ -874,7 +874,6 @@ func (srv *Server) CmdRun(stdin io.ReadCloser, stdout io.Writer, args ...string)
|
|||
if !config.Detach {
|
||||
var attachErr chan error
|
||||
if config.OpenStdin {
|
||||
config.StdinOnce = true
|
||||
Debugf("Attaching with stdin\n")
|
||||
attachErr = container.Attach(stdin, stdout, stdout)
|
||||
} else {
|
||||
|
|
|
@ -101,6 +101,10 @@ func ParseRun(args []string, stdout io.Writer) (*Config, error) {
|
|||
Cmd: runCmd,
|
||||
Image: image,
|
||||
}
|
||||
// When allocating stdin in attached mode, close stdin at client disconnect
|
||||
if config.OpenStdin && !config.Detach {
|
||||
config.StdinOnce = true
|
||||
}
|
||||
return config, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue