cross 943 B

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