github.com/brahmaroutu/docker@v1.2.1-0.20160809185609-eb28dde01f16/hack/make/cross (about) 1 #!/bin/bash 2 set -e 3 4 # explicit list of os/arch combos that support being a daemon 5 declare -A daemonSupporting 6 daemonSupporting=( 7 [linux/amd64]=1 8 [windows/amd64]=1 9 ) 10 11 # if we have our linux/amd64 version compiled, let's symlink it in 12 if [ -x "$DEST/../binary-daemon/dockerd-$VERSION" ]; then 13 mkdir -p "$DEST/linux/amd64" 14 ( 15 cd "$DEST/linux/amd64" 16 ln -s ../../../binary-daemon/* ./ 17 ln -s ../../../binary-client/* ./ 18 ) 19 echo "Created symlinks:" "$DEST/linux/amd64/"* 20 fi 21 22 for platform in $DOCKER_CROSSPLATFORMS; do 23 ( 24 export KEEPDEST=1 25 export DEST="$DEST/$platform" # bundles/VERSION/cross/GOOS/GOARCH/docker-VERSION 26 mkdir -p "$DEST" 27 ABS_DEST="$(cd "$DEST" && pwd -P)" 28 export GOOS=${platform%/*} 29 export GOARCH=${platform##*/} 30 31 if [ -z "${daemonSupporting[$platform]}" ]; then 32 # we just need a simple client for these platforms 33 export LDFLAGS_STATIC_DOCKER="" 34 # remove the "daemon" build tag from platforms that aren't supported 35 export BUILDFLAGS=( "${ORIG_BUILDFLAGS[@]/ daemon/}" ) 36 source "${MAKEDIR}/binary-client" 37 else 38 source "${MAKEDIR}/binary-client" 39 source "${MAKEDIR}/binary-daemon" 40 fi 41 ) 42 done