mirror of https://github.com/docker/docs.git
Forbid attach to ghost
This commit is contained in:
parent
f926ed182f
commit
b76d63cb0c
|
@ -836,6 +836,10 @@ func (srv *Server) CmdAttach(stdin io.ReadCloser, stdout rcli.DockerConn, args .
|
||||||
return fmt.Errorf("No such container: %s", name)
|
return fmt.Errorf("No such container: %s", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if container.State.Ghost {
|
||||||
|
return fmt.Errorf("Impossible to attach to a ghost container")
|
||||||
|
}
|
||||||
|
|
||||||
if container.Config.Tty {
|
if container.Config.Tty {
|
||||||
stdout.SetOptionRawTerminal()
|
stdout.SetOptionRawTerminal()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue