github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/cli/scripts/build/plugins (about) 1 #!/usr/bin/env bash 2 # 3 # Build a static binary for the host OS/ARCH 4 # 5 6 set -eu -o pipefail 7 8 source ./scripts/build/.variables 9 10 mkdir -p "build/plugins-${GOOS}-${GOARCH}" 11 for p in cli-plugins/examples/* "$@" ; do 12 [ -d "$p" ] || continue 13 14 n=$(basename "$p") 15 16 TARGET="build/plugins-${GOOS}-${GOARCH}/docker-${n}" 17 18 echo "Building statically linked $TARGET" 19 export CGO_ENABLED=0 20 GO111MODULE=auto go build -o "${TARGET}" --ldflags "${GO_LDFLAGS}" "github.com/docker/cli/${p}" 21 done