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
|
|
|
|
|
2021-06-14 05:06:42 -04:00
|
|
|
DOCKER_CROSSPLATFORMS=${DOCKER_CROSSPLATFORMS:-"linux/amd64 windows/amd64 linux/ppc64le linux/s390x"}
|
2017-06-20 16:55:40 -04:00
|
|
|
|
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
|
2019-04-16 18:40:53 -04:00
|
|
|
export GOOS=${platform%%/*}
|
|
|
|
export GOARCH=${platform#*/}
|
|
|
|
|
|
|
|
if [[ "${GOARCH}" = "arm/"* ]]; then
|
|
|
|
GOARM=${GOARCH##*/v}
|
|
|
|
GOARCH=${GOARCH%/v*}
|
|
|
|
export GOARM
|
|
|
|
fi
|
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)"
|
2021-04-27 18:40:39 -04:00
|
|
|
source "${MAKEDIR}/binary"
|
2017-11-16 01:20:33 -05:00
|
|
|
|
|
|
|
source "${MAKEDIR}/cross-platform-dependent"
|
2013-12-19 01:06:14 -05:00
|
|
|
)
|
|
|
|
done
|