Print ctr ID if neither STDOUT and STDERR are attached
Closes:
Approved by: rhatdan
package main
import (
+ "fmt"
"os"
gosignal "os/signal"
@@ -170,6 +171,10 @@ func startAttachCtr(ctr *libpod.Container, stdout, stderr, stdin *os.File, detac
ProxySignals(ctr)
}
+ if stdout == nil && stderr == nil {
+ fmt.Printf("%s\n", ctr.ID())
+ }
+
err = <-attachChan
if err != nil {
return errors.Wrapf(err, "error attaching to container %s", ctr.ID())
