diff --git a/container.go b/container.go index 5c4f8aa5fe..bc5e0ab87f 100644 --- a/container.go +++ b/container.go @@ -255,7 +255,11 @@ func (container *Container) Attach(stdin io.ReadCloser, stdinCloser io.Closer, s if container.Config.StdinOnce && !container.Config.Tty { defer cStdin.Close() } - _, err := CopyEscapable(cStdin, stdin) + if container.Config.Tty { + _, err = CopyEscapable(cStdin, stdin) + } else { + _, err = io.Copy(cStdin, stdin) + } if err != nil { Debugf("[error] attach stdin: %s\n", err) }