From b76d63cb0c97aacec6d81c07108d2a573fb8af05 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Fri, 19 Apr 2013 14:18:03 -0700 Subject: [PATCH] Forbid attach to ghost --- commands.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands.go b/commands.go index b0440a9766..de814d6648 100644 --- a/commands.go +++ b/commands.go @@ -836,6 +836,10 @@ func (srv *Server) CmdAttach(stdin io.ReadCloser, stdout rcli.DockerConn, args . 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 { stdout.SetOptionRawTerminal() }