diff --git a/cli/command/container/attach.go b/cli/command/container/attach.go index bd17696b80..ad8c04d04c 100644 --- a/cli/command/container/attach.go +++ b/cli/command/container/attach.go @@ -72,12 +72,12 @@ func NewAttachCommand(dockerCli command.Cli) *cobra.Command { func runAttach(dockerCli command.Cli, opts *attachOptions) error { ctx := context.Background() - client := dockerCli.Client() + apiClient := dockerCli.Client() // request channel to wait for client - resultC, errC := client.ContainerWait(ctx, opts.container, "") + resultC, errC := apiClient.ContainerWait(ctx, opts.container, "") - c, err := inspectContainerAndCheckState(ctx, client, opts.container) + c, err := inspectContainerAndCheckState(ctx, apiClient, opts.container) if err != nil { return err } @@ -109,7 +109,7 @@ func runAttach(dockerCli command.Cli, opts *attachOptions) error { defer signal.StopCatch(sigc) } - resp, errAttach := client.ContainerAttach(ctx, opts.container, options) + resp, errAttach := apiClient.ContainerAttach(ctx, opts.container, options) if errAttach != nil { return errAttach } @@ -123,7 +123,7 @@ func runAttach(dockerCli command.Cli, opts *attachOptions) error { // the container and not exit. // // Recheck the container's state to avoid attach block. - _, err = inspectContainerAndCheckState(ctx, client, opts.container) + _, err = inspectContainerAndCheckState(ctx, apiClient, opts.container) if err != nil { return err }