mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
display id on run -s stdin
This commit is contained in:
parent
32cbd72ebe
commit
ac0e27699c
1 changed files with 8 additions and 2 deletions
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue