github.com/raychaser/docker@v1.5.0/project/make/cross (about)

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