2018-12-10 10:30:19 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# Build a static binary for the host OS/ARCH
|
|
|
|
#
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
source ./scripts/build/.variables
|
|
|
|
|
|
|
|
mkdir -p "build/plugins-${GOOS}-${GOARCH}"
|
2018-12-11 09:15:04 -05:00
|
|
|
for p in cli-plugins/examples/* "$@" ; do
|
2018-12-10 10:30:19 -05:00
|
|
|
[ -d "$p" ] || continue
|
|
|
|
|
|
|
|
n=$(basename "$p")
|
|
|
|
|
|
|
|
TARGET="build/plugins-${GOOS}-${GOARCH}/docker-${n}"
|
|
|
|
|
|
|
|
echo "Building statically linked $TARGET"
|
|
|
|
export CGO_ENABLED=0
|
|
|
|
go build -o "${TARGET}" --ldflags "${LDFLAGS}" "github.com/docker/cli/${p}"
|
|
|
|
done
|