|
@@ -38,9 +38,10 @@ func NewRestartCommand(dockerCli *client.DockerCli) *cobra.Command {
|
|
|
}
|
|
|
|
|
|
func runRestart(dockerCli *client.DockerCli, opts *restartOptions) error {
|
|
|
+ ctx := context.Background()
|
|
|
var errs []string
|
|
|
for _, name := range opts.containers {
|
|
|
- if err := dockerCli.Client().ContainerRestart(context.Background(), name, time.Duration(opts.nSeconds)*time.Second); err != nil {
|
|
|
+ if err := dockerCli.Client().ContainerRestart(ctx, name, time.Duration(opts.nSeconds)*time.Second); err != nil {
|
|
|
errs = append(errs, err.Error())
|
|
|
} else {
|
|
|
fmt.Fprintf(dockerCli.Out(), "%s\n", name)
|