github.com/jwhonce/docker@v0.6.7-0.20190327063223-da823cf3a5a3/hack/make/cross (about)

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