DockerCLI/scripts/build/plugins

22 lines
498 B
Plaintext
Raw Normal View History

#!/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}"
for p in cli-plugins/examples/* "$@" ; do
[ -d "$p" ] || continue
n=$(basename "$p")
TARGET="build/plugins-${GOOS}-${GOARCH}/docker-${n}"
echo "Building statically linked $TARGET"
export CGO_ENABLED=0
2022-03-31 04:30:56 -04:00
GO111MODULE=auto go build -o "${TARGET}" --ldflags "${GO_LDFLAGS}" "github.com/docker/cli/${p}"
done