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