diff --git a/container.go b/container.go index 6b3913522c..34ca696ed8 100644 --- a/container.go +++ b/container.go @@ -250,10 +250,7 @@ func (container *Container) Attach(stdin io.ReadCloser, stdinCloser io.Closer, s if cStderr != nil { defer cStderr.Close() } - if container.Config.StdinOnce { - if container.Config.Tty { - defer container.Kill() - } + if container.Config.StdinOnce && !container.Config.Tty { defer cStdin.Close() } _, err := io.Copy(cStdin, stdin)