Add platform and its components to docker version output
The Server section of version output is now composed of an Engine component and potentially more, based on what the /version endpoint returns. Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
@ -1,15 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
PLATFORM=${PLATFORM:-}
|
||||
VERSION=${VERSION:-"unknown-version"}
|
||||
GITCOMMIT=${GITCOMMIT:-$(git rev-parse --short HEAD 2> /dev/null || true)}
|
||||
BUILDTIME=${BUILDTIME:-$(date --utc --rfc-3339 ns 2> /dev/null | sed -e 's/ /T/')}
|
||||
|
||||
PLATFORM_LDFLAGS=
|
||||
if test -n "${PLATFORM}"; then
|
||||
PLATFORM_LDFLAGS="-X \"github.com/docker/cli/cli.PlatformName=${PLATFORM}\""
|
||||
fi
|
||||
|
||||
export LDFLAGS="\
|
||||
-w \
|
||||
-X github.com/docker/cli/cli.GitCommit=${GITCOMMIT} \
|
||||
-X github.com/docker/cli/cli.BuildTime=${BUILDTIME} \
|
||||
-X github.com/docker/cli/cli.Version=${VERSION} \
|
||||
${PLATFORM_LDFLAGS} \
|
||||
-X \"github.com/docker/cli/cli.GitCommit=${GITCOMMIT}\" \
|
||||
-X \"github.com/docker/cli/cli.BuildTime=${BUILDTIME}\" \
|
||||
-X \"github.com/docker/cli/cli.Version=${VERSION}\" \
|
||||
${LDFLAGS:-} \
|
||||
"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user