mirror of
https://github.com/clearlinux/docker.git
synced 2026-08-25 16:56:11 +00:00
Move the attach prevention from server to client
This commit is contained in:
@@ -1058,6 +1058,10 @@ func (cli *DockerCli) CmdAttach(args ...string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if !container.State.Running {
|
||||
return fmt.Errorf("Impossible to attach to a stopped container, start it first")
|
||||
}
|
||||
|
||||
splitStderr := container.Config.Tty
|
||||
|
||||
connections := 1
|
||||
|
||||
@@ -930,9 +930,6 @@ func (srv *Server) ContainerAttach(name string, logs, stream, stdin, stdout, std
|
||||
if container.State.Ghost {
|
||||
return fmt.Errorf("Impossible to attach to a ghost container")
|
||||
}
|
||||
if !container.State.Running {
|
||||
return fmt.Errorf("Impossible to attach to a stopped container, start it first")
|
||||
}
|
||||
|
||||
var (
|
||||
cStdin io.ReadCloser
|
||||
|
||||
Reference in New Issue
Block a user