cross 951 B

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