2013-12-19 01:06:14 -05:00
|
|
|
#!/bin/bash
|
2014-04-08 00:14:19 -04:00
|
|
|
set -e
|
2013-12-19 01:06:14 -05:00
|
|
|
|
|
|
|
DEST=$1
|
|
|
|
|
2014-08-01 18:57:28 -04:00
|
|
|
# explicit list of os/arch combos that support being a daemon
|
|
|
|
declare -A daemonSupporting
|
|
|
|
daemonSupporting=(
|
|
|
|
[linux/amd64]=1
|
|
|
|
)
|
|
|
|
|
2013-12-24 01:31:53 -05:00
|
|
|
# if we have our linux/amd64 version compiled, let's symlink it in
|
|
|
|
if [ -x "$DEST/../binary/docker-$VERSION" ]; then
|
|
|
|
mkdir -p "$DEST/linux/amd64"
|
|
|
|
(
|
|
|
|
cd "$DEST/linux/amd64"
|
|
|
|
ln -s ../../../binary/* ./
|
|
|
|
)
|
|
|
|
echo "Created symlinks:" "$DEST/linux/amd64/"*
|
|
|
|
fi
|
|
|
|
|
2013-12-19 01:06:14 -05:00
|
|
|
for platform in $DOCKER_CROSSPLATFORMS; do
|
|
|
|
(
|
2013-12-24 01:31:53 -05:00
|
|
|
mkdir -p "$DEST/$platform" # bundles/VERSION/cross/GOOS/GOARCH/docker-VERSION
|
2013-12-19 01:06:14 -05:00
|
|
|
export GOOS=${platform%/*}
|
|
|
|
export GOARCH=${platform##*/}
|
2014-08-01 18:57:28 -04:00
|
|
|
if [ -z "${daemonSupporting[$platform]}" ]; then
|
|
|
|
export LDFLAGS_STATIC_DOCKER="" # we just need a simple client for these platforms
|
|
|
|
export BUILDFLAGS=( "${BUILDFLAGS[@]/ daemon/}" ) # remove the "daemon" build tag from platforms that aren't supported
|
|
|
|
fi
|
2013-12-24 01:31:53 -05:00
|
|
|
source "$(dirname "$BASH_SOURCE")/binary" "$DEST/$platform"
|
2013-12-19 01:06:14 -05:00
|
|
|
)
|
|
|
|
done
|