display id on run -s stdin
Upstream-commit: ac0e27699c0dd9306ae0edabeff5d462399c8e74 Component: engine
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user