#!/usr/bin/env bash set -eu 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/')} 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} \ ${LDFLAGS:-} \ " export TARGET="build/docker-$(go env GOHOSTOS)-$(go env GOHOSTARCH)" export SOURCE="github.com/docker/cli/cmd/docker"