Print container name when successful

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
This commit is contained in:
Ulysses Souza 2020-05-13 10:27:39 +02:00
parent 4e7645aae2
commit 80bc3f3620
1 changed files with 6 additions and 1 deletions

View File

@ -29,6 +29,7 @@ package run
import (
"context"
"fmt"
"strings"
"github.com/docker/docker/pkg/namesgenerator"
@ -45,7 +46,11 @@ func Command() *cobra.Command {
Short: "Run a container",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runRun(cmd.Context(), args[0], opts)
if err := runRun(cmd.Context(), args[0], opts); err != nil {
return err
}
fmt.Println(opts.name)
return nil
},
}