github.com/sams1990/dockerrepo@v17.12.1-ce-rc2+incompatible/hack/make/cross (about)

     1  #!/usr/bin/env bash
     2  set -e
     3  
     4  # if we have our linux/amd64 version compiled, let's symlink it in
     5  if [ -x "$DEST/../binary-daemon/dockerd-$VERSION" ]; then
     6  	arch=$(go env GOHOSTARCH)
     7  	mkdir -p "$DEST/linux/${arch}"
     8  	(
     9  		cd "$DEST/linux/${arch}"
    10  		ln -sf ../../../binary-daemon/* ./
    11  	)
    12  	echo "Created symlinks:" "$DEST/linux/${arch}/"*
    13  fi
    14  
    15  DOCKER_CROSSPLATFORMS=${DOCKER_CROSSPLATFORMS:-"linux/amd64 windows/amd64"}
    16  
    17  for platform in $DOCKER_CROSSPLATFORMS; do
    18  	(
    19  		export KEEPDEST=1
    20  		export DEST="$DEST/$platform" # bundles/VERSION/cross/GOOS/GOARCH/docker-VERSION
    21  		export GOOS=${platform%/*}
    22  		export GOARCH=${platform##*/}
    23  
    24  		echo "Cross building: $DEST"
    25  		mkdir -p "$DEST"
    26  		ABS_DEST="$(cd "$DEST" && pwd -P)"
    27  		source "${MAKEDIR}/binary-daemon"
    28  	)
    29  done