cross 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. set -e
  3. # explicit list of os/arch combos that support being a daemon
  4. declare -A daemonSupporting
  5. daemonSupporting=(
  6. [linux/amd64]=1
  7. [windows/amd64]=1
  8. )
  9. # if we have our linux/amd64 version compiled, let's symlink it in
  10. if [ -x "$DEST/../binary-daemon/dockerd-$VERSION" ]; then
  11. mkdir -p "$DEST/linux/amd64"
  12. (
  13. cd "$DEST/linux/amd64"
  14. ln -s ../../../binary-daemon/* ./
  15. ln -s ../../../binary-client/* ./
  16. )
  17. echo "Created symlinks:" "$DEST/linux/amd64/"*
  18. fi
  19. for platform in $DOCKER_CROSSPLATFORMS; do
  20. (
  21. export KEEPDEST=1
  22. export DEST="$DEST/$platform" # bundles/VERSION/cross/GOOS/GOARCH/docker-VERSION
  23. mkdir -p "$DEST"
  24. ABS_DEST="$(cd "$DEST" && pwd -P)"
  25. export GOOS=${platform%/*}
  26. export GOARCH=${platform##*/}
  27. if [ -z "${daemonSupporting[$platform]}" ]; then
  28. # we just need a simple client for these platforms
  29. export LDFLAGS_STATIC_DOCKER=""
  30. # remove the "daemon" build tag from platforms that aren't supported
  31. export BUILDFLAGS=( "${ORIG_BUILDFLAGS[@]/ daemon/}" )
  32. source "${MAKEDIR}/binary-client"
  33. else
  34. source "${MAKEDIR}/binary-client"
  35. source "${MAKEDIR}/binary-daemon"
  36. fi
  37. )
  38. done