mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #2926 from crosbymichael/attach-wait
Return process exit code for attach
This commit is contained in:
commit
62b1faf28c
2 changed files with 11 additions and 1 deletions
|
@ -1578,6 +1578,15 @@ func (cli *DockerCli) CmdAttach(args ...string) error {
|
|||
if err := cli.hijack("POST", "/containers/"+cmd.Arg(0)+"/attach?"+v.Encode(), container.Config.Tty, in, cli.out, cli.err, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, status, err := getExitCode(cli, cmd.Arg(0))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if status != 0 {
|
||||
return &utils.StatusError{Status: status}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,8 @@ To run the daemon with debug output, use ``docker -d -D``
|
|||
|
||||
You can detach from the container again (and leave it running) with
|
||||
``CTRL-c`` (for a quiet exit) or ``CTRL-\`` to get a stacktrace of
|
||||
the Docker client when it quits.
|
||||
the Docker client when it quits. When you detach from the container's
|
||||
process the exit code will be retuned to the client.
|
||||
|
||||
To stop a container, use ``docker stop``
|
||||
|
||||
|
|
Loading…
Reference in a new issue