Display proper version information

- The cli version defaults to "unknown-version" unless set via the VERSION env var
- The commit version can be overridden via GITCOMMIT env var
- The build time can be overridden via BUILDTIME env var

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure
2017-05-09 09:38:23 -07:00
parent 5cbd2b7d6c
commit cf51bde7d9
10 changed files with 40 additions and 105 deletions

View File

@ -7,6 +7,7 @@ import (
"os"
"runtime"
"github.com/docker/cli/cli"
cliconfig "github.com/docker/cli/cli/config"
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/cli/config/credentials"
@ -15,7 +16,6 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/versions"
"github.com/docker/docker/client"
"github.com/docker/docker/dockerversion"
dopts "github.com/docker/docker/opts"
"github.com/docker/go-connections/sockets"
"github.com/docker/go-connections/tlsconfig"
@ -300,5 +300,5 @@ func newHTTPClient(host string, tlsOptions *tlsconfig.Options) (*http.Client, er
// UserAgent returns the user agent string used for making API requests
func UserAgent() string {
return "Docker-Client/" + dockerversion.Version + " (" + runtime.GOOS + ")"
return "Docker-Client/" + cli.Version + " (" + runtime.GOOS + ")"
}