зеркало из https://github.com/microsoft/docker.git
display id on run -s stdin
This commit is contained in:
Родитель
32cbd72ebe
Коммит
ac0e27699c
10
commands.go
10
commands.go
|
@ -1132,6 +1132,7 @@ func CmdRun(args ...string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var status int
|
||||
if config.AttachStdin || config.AttachStdout || config.AttachStderr {
|
||||
if err := hijack("POST", "/containers/"+out.Id+"/attach?"+v.Encode(), config.Tty); err != nil {
|
||||
return err
|
||||
|
@ -1145,12 +1146,17 @@ func CmdRun(args ...string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
os.Exit(out.StatusCode)
|
||||
status = out.StatusCode
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if !config.AttachStdout && !config.AttachStderr {
|
||||
fmt.Println(out.Id)
|
||||
}
|
||||
|
||||
if status != 0 {
|
||||
os.Exit(status)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче