2017-02-13 14:01:54 -05:00
|
|
|
#!/usr/bin/env bash
|
2014-04-08 00:14:19 -04:00
|
|
|
set -e
|
2013-12-19 01:06:14 -05:00
|
|
|
|
2013-12-24 01:31:53 -05:00
|
|
|
# if we have our linux/amd64 version compiled, let's symlink it in
|
2019-01-09 20:50:47 -05:00
|
|
|
if [ -x "${DEST}/../binary-daemon/dockerd-${VERSION}" ]; then
|
2016-10-03 18:20:51 -04:00
|
|
|
arch=$(go env GOHOSTARCH)
|
|
|
|
mkdir -p "$DEST/linux/${arch}"
|
2013-12-24 01:31:53 -05:00
|
|
|
(
|
2019-01-09 20:50:47 -05:00
|
|
|
cd "${DEST}/linux/${arch}"
|
2017-06-20 16:55:40 -04:00
|
|
|
ln -sf ../../../binary-daemon/* ./
|
2013-12-24 01:31:53 -05:00
|
|
|
)
|
2019-01-09 20:50:47 -05:00
|
|
|
echo "Created symlinks:" "${DEST}/linux/${arch}/"*
|
2013-12-24 01:31:53 -05:00
|
|
|
fi
|
|
|
|
|
2017-06-20 16:55:40 -04:00
|
|
|
DOCKER_CROSSPLATFORMS=${DOCKER_CROSSPLATFORMS:-"linux/amd64 windows/amd64"}
|
|
|
|
|
2019-01-09 20:50:47 -05:00
|
|
|
for platform in ${DOCKER_CROSSPLATFORMS}; do
|
2013-12-19 01:06:14 -05:00
|
|
|
(
|
2016-05-23 21:44:43 -04:00
|
|
|
export KEEPDEST=1
|
2019-01-09 20:50:47 -05:00
|
|
|
export DEST="${DEST}/${platform}" # bundles/VERSION/cross/GOOS/GOARCH/docker-VERSION
|
2013-12-19 01:06:14 -05:00
|
|
|
export GOOS=${platform%/*}
|
|
|
|
export GOARCH=${platform##*/}
|
2016-02-19 17:42:51 -05:00
|
|
|
|
2019-01-09 20:50:47 -05:00
|
|
|
echo "Cross building: ${DEST}"
|
|
|
|
mkdir -p "${DEST}"
|
|
|
|
ABS_DEST="$(cd "${DEST}" && pwd -P)"
|
2017-06-20 16:55:40 -04:00
|
|
|
source "${MAKEDIR}/binary-daemon"
|
2017-11-16 01:20:33 -05:00
|
|
|
|
|
|
|
source "${MAKEDIR}/cross-platform-dependent"
|
2013-12-19 01:06:14 -05:00
|
|
|
)
|
|
|
|
done
|