diff --git a/cli/command/system/info.go b/cli/command/system/info.go index d560c058ee..274b5b64cc 100644 --- a/cli/command/system/info.go +++ b/cli/command/system/info.go @@ -111,11 +111,11 @@ func runInfo(cmd *cobra.Command, dockerCli command.Cli, opts *infoOptions) error fprintln(dockerCli.Err(), err) } } + info.ClientInfo.APIVersion = dockerCli.CurrentVersion() } if opts.format == "" { info.UserName = dockerCli.ConfigFile().AuthConfigs[registry.IndexServer].Username - info.ClientInfo.APIVersion = dockerCli.CurrentVersion() return prettyPrintInfo(dockerCli, info) } return formatInfo(dockerCli.Out(), info, opts.format)