From 80bc3f3620d4d75c9b13c610ee8ee074122872a0 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Wed, 13 May 2020 10:27:39 +0200 Subject: [PATCH] Print container name when successful Signed-off-by: Ulysses Souza --- cli/cmd/run/run.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/cmd/run/run.go b/cli/cmd/run/run.go index f99e9c6e1..b28b6de71 100644 --- a/cli/cmd/run/run.go +++ b/cli/cmd/run/run.go @@ -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 }, }