github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/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 go build -o "${TARGET}" --ldflags "${LDFLAGS}" "github.com/docker/cli/${p}" 21 done